terraform-k8s-hcloud
terraform-k8s-hcloud copied to clipboard
add hcloud csi driver volume support
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.