Reloader icon indicating copy to clipboard operation
Reloader copied to clipboard

Reload Strategies and CD tools

Open norman-zon opened this issue 3 years ago • 2 comments
trafficstars

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.

norman-zon avatar Sep 08 '22 11:09 norman-zon

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

tstollin avatar Jan 17 '23 06:01 tstollin

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?

wojciechlesniewski avatar Mar 27 '23 11:03 wojciechlesniewski