-
Notifications
You must be signed in to change notification settings - Fork 367
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
Gitops tools (argocd) removes created backup resources #503
Comments
Thanks for reporting, but I'm a little confused as to why the Helm Hook helping to make resources not deleted by ArgoCD. Is it possible to set Velero resources as an exception to ArgoCD's orphan resources? |
Hi Got the same issue here : deploying Velero using Helm chart via ArgoCD. When I ask for a new backup, I can see it briefly appearing in ArgoCD UI before it prunes it. I think the cleanest solution here would be to be able to add the Another solution could be to remove ArgoCD label, |
So, found a half working solution for me, adding annotations to the schedule, which are c/c'ed on the backups resources
2nd line protects backups from ArgoCD, all good |
@blackpiglet I guess it is because how ArgoCD is converting the helm hooks and is using them. If i understood correctly the orphan resources can only be set on project level which is unfortunately not feasible. @rgarrigue yes i though about this schedules sync-options solution, too. But it feels not like the cleanest solution, as this option also set the sync-options to the schedules itself, which may not be wanted. |
@luettmattenhas Thanks for the feedback. I also found some information related to the
If ArgoCD is deployed by ArgoCD-Operator, there is another option: https://argocd-operator.readthedocs.io/en/latest/reference/argocd/#resource-exclusions-example This is an example. apiVersion: argoproj.io/v1alpha1
kind: ArgoCD
metadata:
name: velero-argocd
namespace: velero
spec:
resourceExclusions: |
- apiGroups:
- velero.io
kinds:
- Backup
- Restore
clusters:
- "*" |
Just found this issue argoproj/argo-cd#7536. |
@blackpiglet Thanks for the feedback. I stumbled upon this possibility, too. And I think we will look into this and implement it. But it still seems like a cumbersome approach to fix something we could possible fix with a simple annotation :). |
@jenting @qiuming-best |
@jenting This is because the helm hooks are mapped to the ArgoCD hooks. The ArgoCD hooks prevent the We discussed the possible solutions. I suggested configuration from the ArgoCD side but @luettmattenhas thought it's better to add the removed helm hook back. |
But I recall even we add the helm annotation back. If the user is using the ArgoCD, the user have to disable the helm annotation hook by setting |
Looks like different use cases have some conflict. |
This is the 1st PR support disable helm hooks for ArgoCD. |
What steps did you take and what happened:
In our Project we use a gitlab ci pipeline with helm to template helm charts and commit these templated manifests to the git repository. From there they are synced via argocd to the kubernetes.
With this commit the helm hooks got removed which until now prevented the pruning of newly created backup resources.
What did you expect to happen:
Created backups won't be deleted via Gitops tools.
Anything else you would like to add:
I guess the deletion could be mitigated with the "useOwnerReferencesInBackup" option in schedules but they have their own pitfalls. E.g. the backups resources will be deleted if the schedule is changed.
I would like be able to add custom annotations to only the backup resources like "argocd.argoproj.io/sync-options: Prune=false".
Environment:
helm version
): v3.12.3helm list -n <YOUR NAMESPACE>
): helm chart 4.4.1 with corresponding app versionkubectl version
): 1.27.3The text was updated successfully, but these errors were encountered: