-
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
Volumesnapshot getting deleted during backup (argocd) #7905
Comments
https://argo-cd.readthedocs.io/en/stable/user-guide/resource_tracking/ I will check whether it's possible to avoid adding similar labels to the VolumeSnapshot created by the CSI backup. |
@anshulahuja98 Lines 78 to 80 in 6a3e226
|
This is an interesting issue caused by argo CD @blackpiglet, let me try to better understand the fix you are proposing, if we add it to MustHave list, then the pitfall I see is that during restore if user gives label selector, we will end up restoring all VS instead of VS which are actually required. |
Yes, it's possible that unwanted VolumeSnapshots are restored when the label selector is used in restore resource filtering. |
hmm yeah There could be bunch of edge cases which I don't want to enter into, if we restore all VS by default. Overall the right approach to solve it is to maybe when PVC is being restored we restore VS from that code |
Agreed. velero/pkg/restore/actions/csi/pvc_action.go Lines 247 to 250 in 255a51f
|
@reasonerjt / @blackpiglet can we mark this as 1.15 candidate? |
How about we put this issue in v1.15.1? |
ah my bad, I meant 1.16 |
This would be a great thing to fix upstream, I've been taking some more detailed notes on how oadp/velero play w/ argo. At the moment, the suggestion is to WARN in the logs if the argo label is found on the namespace. Interested in hearing other ideas. I like what I see in the comments! My notes - https://github.com/weshayutin/gitops-oadp |
@blackpiglet since VolumeSnapshot won't be present in the cluster, we will have to remove validations present in the code before velero/pkg/restore/actions/csi/pvc_action.go Lines 183 to 190 in 255a51f
|
You are right. |
but will that be sufficient @blackpiglet? Do you have any other suggestion of what can be done? |
This will likely be solved once we do not sync VSC when backup is synced, see more discussions in #7979 |
I have posted a PR to add a backup level warning for such scenarios: #8257
While this does not solve the problem altogether, the warning at the very least notifies the user of the presence of Velero and ArgoCD conflicting systems, which could in turn push the user to take the necessary steps to avoid the undesirable outcomes like updating the resource exclusions in ArgoCD to include PV's, PVC's, VS and VSCs etc (these can be documented). |
I think this won't be fixed @reasonerjt |
Applying
|
Let's investigate the proposed workaround and clarify if anything needs to be done in velero. |
What steps did you take and what happened:
We created a backup for cluster and observe that Volumesnapshot resource was getting deleted by argocd. This lead to failed backup.
argocd uses label for maintaining the inventory of the resources it created. If any other resource is having such label then it will prune/delete it.
While doing backup with velero, velero csi plugin copy the PVC label to volumesnapshot. Because of this, argocd assumes the ownership of newly created VS and prune it since it doesn't match with given manifest.
What did you expect to happen:
Volumesnapshot resource should not have been deleted and backup should succeed.
The following information will help us better understand what's going on:
If you are using velero v1.7.0+:
Please use
velero debug --backup <backupname> --restore <restorename>
to generate the support bundle, and attach to this issue, more options please refer tovelero debug --help
If you are using earlier versions:
Please provide the output of the following commands (Pasting long output into a GitHub gist or other pastebin is fine.)
kubectl logs deployment/velero -n velero
velero backup describe <backupname>
orkubectl get backup/<backupname> -n velero -o yaml
velero backup logs <backupname>
velero restore describe <restorename>
orkubectl get restore/<restorename> -n velero -o yaml
velero restore logs <restorename>
Anything else you would like to add:
Ideally we should avoid copying label of PVC to VS as we don't know why those labels were used. If this is still required then there should be a flag to enable this functionality.
For linking PVC to VS, VS already have the information of PVC.
Environment:
velero version
):velero client config get features
):kubectl version
):/etc/os-release
):Vote on this issue!
This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.
The text was updated successfully, but these errors were encountered: