Skip to content
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

Reload Strategies and CD tools #333

Open
norman-zon opened this issue Sep 8, 2022 · 2 comments
Open

Reload Strategies and CD tools #333

norman-zon opened this issue Sep 8, 2022 · 2 comments

Comments

@norman-zon
Copy link

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.

  1. --reload-strategy=env-vars
    Because only the pod was altered by reloader adding environment variables to it, the CD tool does not see a diff and does not do anything.
  2. --reload-strategy=annotations
    Because the deployment or statefulSet was altered by reloader adding a annotation to its PodTemplate the 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.

@tstollin
Copy link

I can confirm this observation. Switching to --reload-strategy=env-vars fixed a permanent out-of-sync for our ArgoCD deployments using the Reloader.

@wojciechlesniewski
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants