Interview Prep/Kubernetes/Configuration & Storage

How do you expand a PVC?

IntermediateConceptConfiguration & Storage
Answer

The StorageClass must set allowVolumeExpansion: true; edit the PVC's spec.resources.requests.storage to a larger value; the CSI driver resizes the volume, and the filesystem is grown online (or at next mount). Shrinking is not supported.

kubectl patch pvc data -p '{"spec":{"resources":{"requests":{"storage":"50Gi"}}}}'
kubectl get pvc data -w
All Kubernetes questions Roadmap: Kubernetes core

More on Configuration & Storage