- Kubernetes 1.13+ (CSI 1.0).
- The aws-ebs-csi-driver installed.
This example shows you how to write to a dynamically provisioned EBS volume with a specified configuration in the StorageClass
resource.
-
Modify the
StorageClass
resource instorageclass.yaml
as desired. For a list of supported parameters consult the Kubernetes documentation on Storage Classes. -
Deploy the provided pod on your cluster along with the
StorageClass
andPersistentVolumeClaim
:$ kubectl apply -f manifests persistentvolumeclaim/ebs-claim created pod/app created storageclass.storage.k8s.io/ebs-sc created
-
Validate the
PersistentVolumeClaim
is bound to yourPersistentVolume
.$ kubectl get pvc ebs-claim NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE ebs-claim Bound pvc-1fb712f2-632d-4b63-92e4-3b773d698ae1 4Gi RWO ebs-sc 17s
-
Validate the pod successfully wrote data to the dynamically provisioned volume:
$ kubectl exec app -- cat /data/out.txt Wed Feb 23 19:56:12 UTC 2022 ...
-
Cleanup resources:
$ kubectl delete -f manifests persistentvolumeclaim "ebs-claim" deleted pod "app" deleted storageclass.storage.k8s.io "ebs-sc" deleted