-
Notifications
You must be signed in to change notification settings - Fork 86
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
Stash Roles, and Bindings Automatically Pruned by ArgoCD #1570
Comments
Have you ever figured out how to use Stash with ArgoCD? It also tries to add a tmpdir volume to whatever resource you're backing up (STS, deployment, ...), not just injecting a sidecar pod. ArgoCD auto syncs these resources as well, removing the tmpdir volume, causing config errors when trying to deploy the sidecar pod, due to the volume not being available. |
@waza-ari No, I couldn't get it to work properly for me, or for my needs. I even put together a helm chart to abstract some of the volsync boilerplate: https://gitlab.com/GeorgeRaven/raven-helm-charts/-/tree/main/charts/backupd |
Thanks! I will look into it. FWIW, documenting some findings from yesterday when trying to make it work: According to the ArgoCD docs, it should be possible to ignore all changes made by a specific fieldManagers: data:
resource.customizations.ignoreDifferences.apps_StatefulSet: |
managedFieldsManagers:
- stash
# Or, alternatively
resource.customizations.ignoreDifferences.all: |
managedFieldsManagers:
- stash This however does not work at all, most likely due to an open issue in ArgoCD: argoproj/argo-cd#9071. Second attempt was to use jq path expressions like so: data:
resource.customizations.ignoreDifferences.apps_StatefulSet: |
jqPathExpressions:
- '.spec.template.metadata.annotations.["stash.appscode.com/last-applied-backup-invoker-hash"]'
- '.spec.template.spec.volumes[] | select(.name == "stash-tmp-dir")' This does ignore the additional volume and annotation (in this case on STS level), but yields the following Diff result: During Sync, ArgoCD still tries to remove the respective fields, again leading to ContainerCreateErrors like this:
Ultimately, I could only ignore all annotations and/or volumes, but this defeats the purpose of ArgoCD altogether. I'll have a look at VolSync, thank you for the suggestion! |
I am having difficulties with stash under ArgoCD. I notice that whenever a backup is triggered, stash is attempting to create roles and role bindings in a few different places. However, since these are tied to the base application of ArgoCD on creation they are pruned since they are not artefacts of the helm chart. Depending on how quickly these CRs are deleted by argocd, the service accounts for both the trigger and backupconfiguration can be missing permissions to do things like fetch secrets across namespaces, or access stash specific resources.
I have opted to manually define most of these roles, clusterRoles, roleBindings, and clusterRoleBindings, however the CRs should ideally be marked with owner references or the specific labels should be removed since it is the labels which are informing argocd that it is part of the base chart artifacts AFAIK.
I am not sure if this is related but I am also experiencing the following error:
Despite the following conditions on the respective backupsession:
Which I assume could be another potential permission error, where the backupsession was not found due to a lack of permissions. Leading to it not being passed into cobra as an argument.
Any help would be appreciated,
The text was updated successfully, but these errors were encountered: