Kubernetes PVC expansion: kubectl patch pvc

From wikieduonline
Revision as of 12:37, 15 January 2024 by Welcome (talk | contribs) (→‎Example)
Jump to navigation Jump to search

1) List your PVCs:

kubectl get pvc -A
NAMESPACE    NAME                                          STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
dev          elasticsearch-master-elasticsearch-master-0   Bound    pvc-25c6e973-8fc4-463b-9288-123456678903   30Gi       RWO            standard       2y234d

2) Review your StorageClass has AllowVolumeExpansion configured to true.

kubectl describe sc standard | grep AllowVolumeExpansion
AllowVolumeExpansion:  True

3) Request new size

4) Verify it

== Example ==
NAME                     PROVISIONER             RECLAIMPOLICY   VOLUMEBINDINGMODE      
ALLOWVOLUMEEXPANSION   AGE
myname1               ebs.csi.aws.com         Delete          WaitForFirstConsumer   true                   
35d
mynam2          efs.csi.aws.com         Delete          Immediate              true                   
34d
myname3           efs.csi.aws.com         Delete          Immediate              true                   
34d
myname4   efs.csi.aws.com         Delete          Immediate              true                   
33d
gp2                      kubernetes.io/aws-ebs   Delete          WaitForFirstConsumer   
false                  179d

Related

Activities

See also

Advertising: