File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -154,3 +154,29 @@ itself by adding the `csiaddons.openshift.io/state: "unmanaged"` annotation.
154
154
CSI Addons will not perform any further modifications on the ` ReclaimSpaceCronJob ` with the ` unmanaged ` state.
155
155
156
156
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.
You can’t perform that action at this time.
0 commit comments