Loading compose.yml +1 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ services: DISK_SIZE: "16G" devices: - /dev/kvm - /dev/net/tun cap_add: - NET_ADMIN ports: Loading kubernetes.yml +40 −32 Original line number Diff line number Diff line --- apiVersion: v1 kind: PersistentVolumeClaim metadata: Loading @@ -16,44 +17,51 @@ metadata: 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 securityContext: privileged: true env: - name: RAM_SIZE value: 1G value: "1G" - name: CPU_CORES value: "1" - name: DISK_SIZE value: "16G" # Kubernetes uses Gi, but DSM uses GB value: "16G" ports: - containerPort: 5000 securityContext: capabilities: add: - NET_ADMIN privileged: true volumeMounts: - mountPath: /storage name: storage - mountPath: /dev/kvm name: dev-kvm - mountPath: /dev/net/tun name: dev-tun terminationGracePeriodSeconds: 120 volumes: - name: storage persistentVolumeClaim: claimName: dsm-pvc - name: dev-kvm hostPath: - hostPath: path: /dev/kvm name: dev-kvm - hostPath: path: /dev/net/tun type: CharDevice name: dev-tun --- apiVersion: v1 kind: Service metadata: name: dsm spec: type: NodePort selector: name: dsm ports: - name: tcp-5000 port: 5000 targetPort: 5000 selector: name: dsm type: NodePort readme.md +2 −1 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ services: DISK_SIZE: "16G" devices: - /dev/kvm - /dev/net/tun cap_add: - NET_ADMIN ports: Loading @@ -45,7 +46,7 @@ services: Via Docker CLI: ```bash docker run -it --rm -p 5000:5000 --device=/dev/kvm --cap-add NET_ADMIN --stop-timeout 120 vdsm/virtual-dsm docker run -it --rm -p 5000:5000 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN --stop-timeout 120 vdsm/virtual-dsm ``` Via Kubernetes: Loading Loading
compose.yml +1 −0 Original line number Diff line number Diff line Loading @@ -6,6 +6,7 @@ services: DISK_SIZE: "16G" devices: - /dev/kvm - /dev/net/tun cap_add: - NET_ADMIN ports: Loading
kubernetes.yml +40 −32 Original line number Diff line number Diff line --- apiVersion: v1 kind: PersistentVolumeClaim metadata: Loading @@ -16,44 +17,51 @@ metadata: 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 securityContext: privileged: true env: - name: RAM_SIZE value: 1G value: "1G" - name: CPU_CORES value: "1" - name: DISK_SIZE value: "16G" # Kubernetes uses Gi, but DSM uses GB value: "16G" ports: - containerPort: 5000 securityContext: capabilities: add: - NET_ADMIN privileged: true volumeMounts: - mountPath: /storage name: storage - mountPath: /dev/kvm name: dev-kvm - mountPath: /dev/net/tun name: dev-tun terminationGracePeriodSeconds: 120 volumes: - name: storage persistentVolumeClaim: claimName: dsm-pvc - name: dev-kvm hostPath: - hostPath: path: /dev/kvm name: dev-kvm - hostPath: path: /dev/net/tun type: CharDevice name: dev-tun --- apiVersion: v1 kind: Service metadata: name: dsm spec: type: NodePort selector: name: dsm ports: - name: tcp-5000 port: 5000 targetPort: 5000 selector: name: dsm type: NodePort
readme.md +2 −1 Original line number Diff line number Diff line Loading @@ -33,6 +33,7 @@ services: DISK_SIZE: "16G" devices: - /dev/kvm - /dev/net/tun cap_add: - NET_ADMIN ports: Loading @@ -45,7 +46,7 @@ services: Via Docker CLI: ```bash docker run -it --rm -p 5000:5000 --device=/dev/kvm --cap-add NET_ADMIN --stop-timeout 120 vdsm/virtual-dsm docker run -it --rm -p 5000:5000 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN --stop-timeout 120 vdsm/virtual-dsm ``` Via Kubernetes: Loading