Argo CD Can Adopt a Running Helm Release When It Renders the Same Chart, Values and Release Name

Kubernetes

Argo CD doesn't run helm install. It renders a chart with helm template and applies the result like any other manifests, matching objects by kind, namespace and name. So a release installed by hand can be taken over without reinstalling it: point an Application at the same chart, version, values and release name, and the objects Argo CD wants are the objects already running. The first sync then only adds Argo CD's tracking annotation, and no pod restarts. That's how my cluster's CNI moved under GitOps without a network blip (see GitOps Agents Pull the Desired State from Git and Revert Changes Made Outside It).

What Must Match

Input Why it matters
Chart and exact version Another version renders other templates, often a new pod spec, so a rollout
Values Copy them from helm get values <release> -n <ns>, not from memory: a --set flag forgotten in Git changes the render
Release name (helm.releaseName) Charts put .Release.Name in labels and names; a different name means different objects
Namespace Same reason

Two settings make the takeover safe to watch:

  • Manual sync. The Application only shows the difference until you sync it.
  • Annotation tracking (the default since Argo CD 3.0). Argo CD marks its objects with argocd.argoproj.io/tracking-id, so it doesn't fight over the app.kubernetes.io/instance label that many charts already set.

Read the Diff, Then Sync

argocd app diff <app> compares the render with the live objects. An adoption diff should contain nothing but the tracking annotation. A change inside a Deployment's or DaemonSet's spec.template means the sync will restart pods; a changed ConfigMap key means a changed configuration. Either one says an input doesn't match yet: fix Git, diff again. For a component the whole cluster depends on, take a backup first (for the control plane, an etcd snapshot).

Charts That Generate Secrets on Every Render

Some charts create certificates or passwords with Helm functions (genCA, randAlphaNum). Helm runs them once at install; Argo CD renders on every refresh, so the output never matches the live Secret and the app stays OutOfSync. Worse, a sync would replace working certificates. Cilium does this for Hubble's TLS (cilium-ca, hubble-server-certs; kubectl get secret,cm -A -l cilium.io/helm-template-non-idempotent=true lists them). The fix is two settings on the Application:

  • ignoreDifferences on those objects' /data, so the diff ignores them;
  • the sync option RespectIgnoreDifferences=true, so a sync keeps the live values instead of writing the fresh render. Without it, ignoreDifferences only hides the change from the diff.

After the Takeover

  • Never helm upgrade that release again. Helm's release record is frozen at the bootstrap; an upgrade would apply Helm's idea of the release over Argo CD's. Changes go through Git and a sync.
  • The first sync with Argo CD's default (client-side) apply prints missing the kubectl.kubernetes.io/last-applied-configuration annotation for every object: Helm doesn't set it, and apply adds it. Harmless. ServerSideApply=true avoids the annotation altogether.
  • The same works for Argo CD itself: install it once with Helm, then let an Application render the same chart and values, and it manages its own upgrades (see In an App of Apps, Only the Root Is Applied by Hand, So Its Sync Policy Decides What a Commit Can Delete).

References

Review cards

Flashcard What has to match for Argo CD to take over a Helm release without changing it?

The chart and its exact version, the values, the release name and the namespace. Then the render equals the running objects and the first sync only adds the tracking annotation.

Flashcard Where should the values for an adopted release come from, and why?

From helm get values <release>: a --set flag that isn't copied into Git changes the render, and the sync would change the running release.

Quiz A chart generates a TLS certificate on every render. Which settings stop Argo CD from replacing the live one on sync?
  • ignoreDifferences alone
  • ignoreDifferences plus the sync option RespectIgnoreDifferences=true
  • ServerSideApply=true
  • Automated sync with selfHeal

ignoreDifferences only hides the field from the diff; RespectIgnoreDifferences makes a sync keep the live value.

Flashcard Why must you stop running `helm upgrade` on a release Argo CD has adopted?

Helm's release record is frozen at the bootstrap, so an upgrade applies Helm's version over what Git says. Changes go through Git and an Argo CD sync.