mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-06-09 01:47:32 +08:00
add Kubernetes manifest. Fixes #687
This commit is contained in:
parent
1d64410849
commit
6d3d339144
60
kube-dsm.yaml
Normal file
60
kube-dsm.yaml
Normal file
@ -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
readme.md
12
readme.md
@ -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
|
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
|
## FAQ
|
||||||
|
|
||||||
* ### How do I use it?
|
* ### How do I use it?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user