-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Add documentation for disabling ReclaimSpace #701
Merged
+26
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -154,3 +154,29 @@ 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=="<PVC_NAME>")]}{.metadata.name}{"\n"}{end}' | ||
``` | ||
|
||
Replace `<PVC_NAME>` 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"`. | ||
```bash | ||
kubectl annotate reclaimspacecronjobs <RECLAIMSPACECRONJOB_NAME> "csiaddons.openshift.io/state=unmanaged" --overwrite=true | ||
``` | ||
- Add `suspend: true` under the `spec` field. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please provide `kubectl patch command as well for this one There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
```bash | ||
kubectl patch reclaimspacecronjobs <RECLAIMSPACECRONJOB_NAME> -p '{"spec": {"suspend": true}}' --type=merge | ||
``` | ||
|
||
These changes will disable reclaim space for the specified PVC. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will be good if we add example for kubectl annotate and kubectl patch command
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I did not go with that is because
kubectl edit
and can do both the required changes simultaneously.Lesser the commands, the better it is, WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kubectl edit
is not something that can be automated easily. I prefer to give thekubectl annotate
andkubectl patch
commands as examples, in addition to the description you have now.Fewer commands is nice, but you should also expect that automated tools deploy apps and configure extra things like disabling reclaim space for its PVC(s).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide the command to annotate the CR as mentioned above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!