Skip to content

Commit

Permalink
add Kubernetes manifest. Fixes vdsm#687
Browse files Browse the repository at this point in the history
  • Loading branch information
slavik.fursov committed May 15, 2024
1 parent 1d64410 commit 6d3d339
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
60 changes: 60 additions & 0 deletions kube-dsm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: dsm-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 32Gi
---
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: 4G
- name: CPU_CORES
value: "2"
- name: DISK_SIZE
value: "30G" # Kubernetes uses Gi, but DSM uses GB
- name: DISK_FMT
value: "qcow2"
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
12 changes: 12 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,18 @@ 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:
- download `kube-dsm.yaml`
- edit it, according to your need
- deploy it:
```shell
kubectl apply -f kube-dsm.yaml
```

Notes:
- depending on the kind of storage you're using, you may want to pre-create PVC first. If so - remove PVC section from the manifest
- you can add Ingress to the manifest. I found, that if I use DNS name to access DSM UI - that can only be done via HTTPS. Accessing UI via DNS with HTTP results in error `You are not authorized to use this service`

## FAQ

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

0 comments on commit 6d3d339

Please sign in to comment.