terraform-k8s-hcloud icon indicating copy to clipboard operation
terraform-k8s-hcloud copied to clipboard

add hcloud csi driver volume support

Open anon6789 opened this issue 5 years ago • 0 comments
trafficstars

This PR adds support for persistent volumes in kubernetes using the csi-driver. Feature mentioned here.

To test set csi_driver_enabled = true and use the following snippet*:

cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: csi-pvc
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
  storageClassName: hcloud-volumes
---
kind: Pod
apiVersion: v1
metadata:
  name: my-csi-app
spec:
  containers:
    - name: my-frontend
      image: busybox
      volumeMounts:
      - mountPath: "/data"
        name: my-csi-volume
      command: [ "sleep", "1000000" ]
  volumes:
    - name: my-csi-volume
      persistentVolumeClaim:
        claimName: csi-pvc
EOF

*from here

Then monitor the pod, the pvc and the volumes in hcloud dashboard.

anon6789 avatar Aug 14 '20 07:08 anon6789