-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
add restore item action to update PVC selected-node annotation #2377
Conversation
…elected-node` Signed-off-by: mayank <[email protected]>
Signed-off-by: mayank <[email protected]>
For the core team: This seems to be the restore side of the same logical issue we are discussing on the backup side in this ticket #1878. |
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.
thanks for the PR @mynktl! It looks pretty good, just a few small comments. Two further requests:
- add a changelog (
changelogs/unreleased/2377-mynktl
) with a brief description of the change - update
site/docs/master/restore-reference.md
with info about this plugin - you can use the "Changing PV/PVC Storage Classes" section as a template
Signed-off-by: mayank <[email protected]>
Hi @skriss
Thanks! |
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.
thanks for the updates @mynktl, LGTM! We'll just need one other reviewer.
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.
👍 and thanks for the tests!
…e-tanzu#2377) * New RestoreItemAction for PVC with annotation `volume.kubernetes.io/selected-node` Signed-off-by: mayank <[email protected]>
According to my test on k8s v1.22, without this plugin, the restore can still work. But I think this plugin's code still can be useful in some cases, of course, although it's not mandatory for restore to work. |
This change solve below issue
If backed-up persistentvolumeclaims resource has an annotation of selected-node(
volume.kubernetes.io/selected-node
) and the given node doesn't exist in destination cluster, where the restore is triggered, then restore will stuckInProgress
state.Approach
This restoreItemAction works for
persistentvolumeclaims
resource having an annotationvolume.kubernetes.io/selected-node
.If node-mapping for the given node exists in configMap(in velero installation namespace, with label selector
velero.io/plugin-config,velero.io/change-pvc-node=RestoreItemAction
), then the plugin will update the PVC annotation with new node and return the updated resource.If node-mapping for the given node doesn't exist, then the plugin will check for the given node existence. If the given node doesn't exist in the cluster, then the plugin will delete the annotation for selected-node and return the updated
persistentvolumeclaims
resource.Signed-off-by: mayank [email protected]