Recover From PVC Expansion Failure
When PVC expansion fails in Kubernetes, administrators can manually recover the Persistent Volume Claim (PVC) state and cancel the expansion request.
TOC
Procedure
-
Modify the reclaim policy of the Persistent Volume (PV) bound to the PVC to
Retain. To do this, edit the corresponding PV and set thepersistentVolumeReclaimPolicyfield toRetain. -
Delete the original PVC.
-
Manually edit the PV to remove the
claimRefentry from its specifications. This ensures that the new PVC can bind to this PV, changing the PV's status toAvailable. -
Recreate a new PVC with a smaller size or a size supported by the underlying storage provider.
-
Explicitly specify the
volumeNamefield in the new PVC to match the original PV name. This ensures that the new PVC accurately binds to the specified PV. -
Finally, restore the original reclaim policy of the PV.
Additional Tips
- Ensure that the
StorageClassin use has volume expansion enabled by settingallowVolumeExpansiontotrue. - Perform these actions carefully to avoid the risk of data loss.