Prerequisites
kubectlconfigured with access to the cluster where the PVC was deleted.- Admin permissions on the cluster (
adminCluster RoleBinding). - You know the name and namespace of the deleted PVC.
- The 24-hour soft-delete window has not yet elapsed since the PVC was deleted.
Step 1: Find the original PV
Even after a PVC is deleted, its PV remains in the cluster until PVMO removes it. List all PVs to locate the one associated with the deleted PVC:Released status. If you know the original PVC name, you can filter by the claim reference in the CLAIM column (for example, [NAMESPACE]/[PVC-NAME]).
Once you identify the PV, record its name. Replace [PV-NAME] with the PV name you found:
| Field | Example value |
|---|---|
spec.capacity.storage | 4000Ti |
spec.accessModes | [ReadWriteMany] |
spec.storageClassName | shared-vast |
spec.csi.driver | csi.vast.io |
spec.csi.volumeHandle | pvc-a07727ce-9a7f-4f14-892d-0ea8f69712e9@prod-02 |
spec.csi.volumeHandle value is the unique identifier for the volume on the VAST storage backend. You must use the original value, not the new PV name. Using the new PV name instead will cause the CSI driver to search for a volume that does not exist.
Step 2: Create a new Persistent Volume
Create a new PV manifest that points to the same VAST volume handle. Replace the placeholder values with the values you recorded in step 1. Replace[NEW-PV-NAME] with a unique name for the new PV (for example, [ORIGINAL-PV-NAME]-recovered):
new-pv.yaml
Set
persistentVolumeReclaimPolicy: Retain on the new PV. This ensures that if the new PVC is deleted before PVMO’s countdown on the original PV expires, the new PV itself is not immediately reclaimed.[PV-MANIFEST-FILE] with the path to your manifest:
Step 3: Create a new Persistent Volume Claim
Create a PVC manifest in the target namespace that binds explicitly to the new PV. Replace[NEW-PVC-NAME] and [TARGET-NAMESPACE] with your values:
new-pvc.yaml
volumeName field explicitly binds this PVC to the PV you created in step 2. Without it, Kubernetes may bind to a different available PV.
Apply the manifest. Replace [PVC-MANIFEST-FILE] with the path to your manifest:
Step 4: Verify the binding
Confirm that both the new PV and new PVC are inBound status:
Example output
Bound, you can mount the new PVC in a pod as you would any other PVC. The original VAST data is accessible through the new PVC.
Step 5: Protect the PV from future deletion
After rebinding, add the protect label to the original PV to prevent PVMO from ever automatically deleting it. Replace[PV-NAME] with the name of the original PV from step 1:
The trailing
- in the second command is kubectl syntax for removing a label.