Skip to content

Commit 38be3f0

Browse files
Merge pull request csi-addons#237 from red-hat-storage/sync_us--main
Syncing latest changes from upstream main for kubernetes-csi-addons
2 parents c386b0e + 15cf548 commit 38be3f0

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/reclaimspace.md

+26
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,29 @@ itself by adding the `csiaddons.openshift.io/state: "unmanaged"` annotation.
154154
CSI Addons will not perform any further modifications on the `ReclaimSpaceCronJob` with the `unmanaged` state.
155155

156156
To have a custom schedule the user can then modify the `schedule` field of the `ReclaimSpaceCronJob` spec.
157+
158+
## Disabling Reclaim Space
159+
160+
### Disabling Reclaim Space for a Specific PersistentVolumeClaim
161+
162+
To disable reclaim space for a specific PersistentVolumeClaim (PVC), follow these steps to modify the associated `ReclaimSpaceCronJob` CR:
163+
164+
1. **Identify the `ReclaimSpaceCronJob` CR**: Run the following command to retrieve the name of the `ReclaimSpaceCronJob` CR associated with the PVC:
165+
166+
```bash
167+
kubectl get reclaimspacecronjobs -o jsonpath='{range .items[?(@.spec.jobTemplate.spec.target.persistentVolumeClaim=="<PVC_NAME>")]}{.metadata.name}{"\n"}{end}'
168+
```
169+
170+
Replace `<PVC_NAME>` with the name of your PVC.
171+
172+
2. **Edit the `ReclaimSpaceCronJob` CR**: Apply the following to disable the reclaim space:
173+
- Update the `csiaddons.openshift.io/state` annotation from `"managed"` to `"unmanaged"`.
174+
```bash
175+
kubectl annotate reclaimspacecronjobs <RECLAIMSPACECRONJOB_NAME> "csiaddons.openshift.io/state=unmanaged" --overwrite=true
176+
```
177+
- Add `suspend: true` under the `spec` field.
178+
```bash
179+
kubectl patch reclaimspacecronjobs <RECLAIMSPACECRONJOB_NAME> -p '{"spec": {"suspend": true}}' --type=merge
180+
```
181+
182+
These changes will disable reclaim space for the specified PVC.

0 commit comments

Comments
 (0)