Difference between revisions of "Kubernetes PVC expansion: kubectl patch pvc"

From wikieduonline
Jump to navigation Jump to search
Line 1: Line 1:
  
List your PVCs:
+
1) List your PVCs:
 
  [[kubectl get pvc -A]]
 
  [[kubectl get pvc -A]]
  
Line 6: Line 6:
 
  dev          elasticsearch-master-elasticsearch-master-0  Bound    pvc-25c6e973-8fc4-463b-9288-123456678903  30Gi      RWO            standard      2y234d
 
  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
 
* <code>kubectl -n [[your-namespace]] [[kubectl patch|patch]] pvc your-pvc-name -p '{"spec":{"resources":{"requests":{"storage":"16Gi"}}}}}'</code>
 
* <code>kubectl -n [[your-namespace]] [[kubectl patch|patch]] pvc your-pvc-name -p '{"spec":{"resources":{"requests":{"storage":"16Gi"}}}}}'</code>
  
 +
4) Verify it
  
 
== Related ==
 
== Related ==

Revision as of 06:28, 23 November 2022

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

  • kubectl -n your-namespace patch pvc your-pvc-name -p '{"spec":{"resources":{"requests":{"storage":"16Gi"}}}}}'

4) Verify it

Related

See also

Advertising: