This repository contains example manifests that demonstrate the usage of the Linode BlockStorage CSI Driver. These manifests create a PersistentVolumeClaim (PVC) using the linode-block-storage-retain
storage class and then consume it in a minimal pod.
You can find more example manifests here.
kubectl create -f https://raw.githubusercontent.com/linode/linode-blockstorage-csi-driver/master/internal/driver/examples/kubernetes/csi-pvc.yaml
kubectl create -f https://raw.githubusercontent.com/linode/linode-blockstorage-csi-driver/master/internal/driver/examples/kubernetes/csi-app.yaml
Verify the Pod and PVC:
kubectl get pvc/csi-example-pvc pods/csi-example-pod
kubectl describe pvc/csi-example-pvc pods/csi-example-pod
Persist Data Example:
-
Write Data:
kubectl exec -it csi-example-pod -- /bin/sh -c "echo persistence > /data/example.txt; ls -l /data"
-
Delete and Recreate Pod:
kubectl delete pods/csi-example-pod kubectl create -f https://raw.githubusercontent.com/linode/linode-blockstorage-csi-driver/master/pkg/linode-bs/examples/kubernetes/csi-app.yaml
-
Verify Data Persistence:
sleep 30 kubectl exec -it csi-example-pod -- /bin/sh -c "ls -l /data; cat /data/example.txt"