Skip to content

Commit

Permalink
feat: Add Kubernetes manifest (#735)
Browse files Browse the repository at this point in the history
  • Loading branch information
SlavikCA committed May 15, 2024
1 parent 41e0157 commit 3126b38
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
58 changes: 58 additions & 0 deletions kubernetes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: dsm-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 16Gi
---
apiVersion: v1
kind: Pod
metadata:
name: dsm
labels:
name: dsm
spec:
terminationGracePeriodSeconds: 120 # the Kubernetes default is 30 seconds and it may be not enough
containers:
- name: dsm
image: vdsm/virtual-dsm
ports:
- containerPort: 5000
protocol: TCP
resources:
limits:
devices.kubevirt.io/kvm: 1
securityContext:
privileged: true
env:
- name: RAM_SIZE
value: 1G
- name: CPU_CORES
value: "1"
- name: DISK_SIZE
value: "16G" # Kubernetes uses Gi, but DSM uses GB
volumeMounts:
- mountPath: /storage
name: storage
volumes:
- name: storage
persistentVolumeClaim:
claimName: dsm-pvc
---
apiVersion: v1
kind: Service
metadata:
name: dsm
spec:
type: NodePort
selector:
name: dsm
ports:
- name: tcp-5000
port: 5000
targetPort: 5000
nodePort: 31150
6 changes: 6 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ Via Docker CLI:
docker run -it --rm --name dsm -p 5000:5000 --device=/dev/kvm --cap-add NET_ADMIN --stop-timeout 120 vdsm/virtual-dsm
```

Via Kubernetes:

```shell
kubectl apply -f kubernetes.yml
```

## FAQ

* ### How do I use it?
Expand Down

0 comments on commit 3126b38

Please sign in to comment.