Reloader
Reloader copied to clipboard
Reload Strategies and CD tools
According to the README --reload-strategy=annotations is intended to work with auto-reconciliation using CD tools loke ArgoCD or FluxCD.
Either I get this wrong, or the README is the wrong way around regarding this point.
From the README regarding --reload-strategy=annotations:
This strategy is useful when using resource syncing tools like ArgoCD, since it will not cause these tools to detect configuration drift after a resource is reloaded.
But to me this seems not to be the case.
CD tools watch the ressources they have manifests for usually deployments or statefulSets, but not pods and containers.
So, for the two strategies, when the CD tool runs a reconciliation the following happens.
--reload-strategy=env-varsBecause only thepodwas altered by reloader adding environment variables to it, the CD tool does not see a diff and does not do anything.--reload-strategy=annotationsBecause thedeploymentorstatefulSetwas altered by reloader adding a annotation to itsPodTemplatethe CD tool sees a diff, removes the annotation and thus triggers a rollout.
So as I see it when using CD tools with auto-reconciliation --reload-strategy=env-vars is the way to go.
I can confirm this observation. Switching to --reload-strategy=env-vars fixed a permanent out-of-sync for our ArgoCD deployments using the Reloader.
Hi, we have a similar issue with our reloader and ArgoCD.
For both strategies, env-vars and annotation, when we change the Kubernetes secret, ArgoCD creates a new replica set and only one pod is reloaded to use a new version of the secret. It is worth mentioning that we use SOPS for secrets.
After a few tests, we figure out that the problem is with the ArgoCD app configuration. We set replace=true for the sync policy in the argoCD app manifest and when we change it to false, both strategies seem to work properly.
Agree that the documentation is a lite bit confusing. How should it be set up correctly? Is it recommended to use the ignoredifferences setting for the annotation strategy?