- Kubernetes 1.13+ (CSI 1.0).
- The aws-ebs-csi-driver installed.
In this example, an EBS volume of 4Gi
is resized to 8Gi
using the volume resizing feature.
-
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/resize-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-b0f6d590-f4b3-4329-a118-49cd09f6993c 4Gi RWO resize-sc 28s
-
Expand the volume size by increasing the
capacity
specification in thePersistentVolumeClaim
.$ export KUBE_EDITOR="nano" && kubectl edit pvc ebs-claim
-
Verify that both the persistence volume and persistence volume claim have been appropriately resized:
$ kubectl get pv && kubectl get pvc NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS pvc-b0f6d590-f4b3-4329-a118-49cd09f6993c 8Gi RWO Delete Bound default/ebs-claim resize-sc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE ebs-claim Bound pvc-b0f6d590-f4b3-4329-a118-49cd09f6993c 8Gi RWO resize-sc 23m
-
Cleanup resources:
$ kubectl delete -f manifests persistentvolumeclaim "ebs-claim" deleted pod "app" deleted storageclass.storage.k8s.io "resize-sc" deleted