When PVC expansion fails in Kubernetes, administrators can manually recover the Persistent Volume Claim (PVC) state and cancel the expansion request.
Modify the reclaim policy of the Persistent Volume (PV) bound to the PVC to Retain
. To do this, edit the corresponding PV and set the persistentVolumeReclaimPolicy
field to Retain
.
Delete the original PVC.
Manually edit the PV to remove the claimRef
entry from its specifications. This ensures that the new PVC can bind to this PV, changing the PV's status to Available
.
Recreate a new PVC with a smaller size or a size supported by the underlying storage provider.
Explicitly specify the volumeName
field 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.
StorageClass
in use has volume expansion enabled by setting allowVolumeExpansion
to true
.