diff --git a/docs/reclaimspace.md b/docs/reclaimspace.md index 49f500dd3..d093ad68b 100644 --- a/docs/reclaimspace.md +++ b/docs/reclaimspace.md @@ -154,3 +154,23 @@ itself by adding the `csiaddons.openshift.io/state: "unmanaged"` annotation. CSI Addons will not perform any further modifications on the `ReclaimSpaceCronJob` with the `unmanaged` state. To have a custom schedule the user can then modify the `schedule` field of the `ReclaimSpaceCronJob` spec. + +## Disabling Reclaim Space + +### Disabling Reclaim Space for a Specific PersistentVolumeClaim + +To disable reclaim space for a specific PersistentVolumeClaim (PVC), follow these steps to modify the associated `ReclaimSpaceCronJob` CR: + +1. **Identify the `ReclaimSpaceCronJob` CR**: Run the following command to retrieve the name of the `ReclaimSpaceCronJob` CR associated with the PVC: + + ```bash + kubectl get reclaimspacecronjobs -o jsonpath='{range .items[?(@.spec.jobTemplate.spec.target.persistentVolumeClaim=="")]}{.metadata.name}{"\n"}{end}' + ``` + + Replace `` with the name of your PVC. + +2. **Edit the `ReclaimSpaceCronJob` CR**: Apply the following to disable the reclaim space: + - Update the `csiaddons.openshift.io/state` annotation from `"managed"` to `"unmanaged"`. + - Add `suspend: true` under the `spec` field. + +These changes will disable reclaim space for the specified PVC.