Skip to content

Argo CD reconciliation patterns: CAPA practice questions

Reconciliation is the loop in which the application controller compares the target state in Git with the live state in the cluster and, depending on policy, brings them together. Most of the patterns around it answer three questions: when the comparison runs, what counts as a difference, and what Argo CD does about one.

By Ibrahim Yesilay · Published · Updated

Independent community practice, not affiliated with or endorsed by CNCF or The Linux Foundation.

What Argo CD reconciliation patterns covers in CAPA

Reconciliation is the loop in which the application controller compares the target state in Git with the live state in the cluster and, depending on policy, brings them together. Most of the patterns around it answer three questions: when the comparison runs, what counts as a difference, and what Argo CD does about one.

The comparison runs on a timer and on demand. By default Argo CD refreshes every three minutes, a 120-second reconciliation timeout plus up to 60 seconds of jitter set in argocd-cm, and a Git webhook triggers a refresh immediately. A hard refresh also discards cached manifests, which helps after a transient generation error.

Drift is any difference between the two states. With selfHeal enabled on automated sync, Argo CD reverts changes made directly in the cluster; without it the application simply shows OutOfSync. With prune enabled, resources removed from Git are deleted from the cluster; without it they remain and are marked as needing pruning. Some fields are changed legitimately by other controllers, such as a replica count managed by a HorizontalPodAutoscaler or a field injected by a webhook. ignoreDifferences removes them from the comparison with jsonPointers, jqPathExpressions or managedFieldsManagers, and the RespectIgnoreDifferences=true sync option keeps a sync from overwriting them too.

Health is reconciled alongside sync status. Built-in checks cover common kinds, for example a Deployment is healthy when its updated replicas match the desired count and a PersistentVolumeClaim when it is Bound, and custom checks for other resources are written in Lua in argocd-cm. An application can therefore be Synced and Degraded at the same time.

At a larger scale, the same loop is applied to many applications. In the app of apps pattern, one Application points at a directory of Application manifests, so syncing it creates the others; the documentation calls it an admin-only tool, because creating Applications is an administrative capability. The ApplicationSet controller generates Applications from a template and generators such as List, Cluster, Git, Matrix, Merge, SCM Provider and Pull Request, so adding a cluster or a directory adds an application automatically. Sync waves order dependent resources within one sync.

Key points

  • selfHeal reverts manual cluster changes; prune removes resources deleted from Git.
  • ignoreDifferences keeps fields owned by other controllers out of the diff.
  • Custom health checks are written in Lua in argocd-cm.
  • ApplicationSet generators create Applications from lists, clusters, Git paths and more.

Three sample questions

14 CAPA questions on Argo CD reconciliation patterns, 14 with explanations. How practice works

Question 1

What is the correct way to configure automated sync in an Argo CD Application?
spec:
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
  1. A.The configuration is correct
  2. B.automated should be auto
  3. C.selfHeal should be autoHeal
  4. D.prune should be under spec

Correct answer: A

Under spec.syncPolicy, the automated block enables auto-sync, prune: true lets it delete resources removed from Git, and selfHeal: true re-syncs when the live cluster drifts. The application specification lists all of these names as written here. Why the other options are wrong. "automated should be auto": the field is automated; the docs show syncPolicy.automated and no auto key. "selfHeal should be autoHeal": the documented name is selfHeal (the CLI flag is --self-heal), not autoHeal. "prune should be under spec": prune is a key inside syncPolicy.automated, so it is already in the right place; spec holds syncPolicy, not prune.

Sources: Argo CD docs: Automated Sync Policy, Argo CD docs: Application Specification Reference

Question 2

What is the correct way to ignore differences in a specific field using ignoreDifferences?
spec:
  ignoreDifferences:
    - group: apps
      kind: Deployment
      jsonPointers:
        - /spec/replicas
  1. A.The configuration is correct
  2. B.jsonPointers should be paths
  3. C.group should be apiGroup
  4. D.The syntax is completely wrong

Correct answer: A

ignoreDifferences entries select resources by group and kind and name the fields to skip with jsonPointers. The diffing guide shows group: apps, kind: Deployment and /spec/replicas, which is the configuration given here. Why the other options are wrong. "jsonPointers should be paths": the documented field is jsonPointers; the guide does not show a paths field for this. "group should be apiGroup": the field is group, the Kubernetes API group without version; apiGroup is not used. "The syntax is completely wrong": the syntax matches the documented example, so it is not wrong.

Sources: Argo CD docs: Diffing Customization, Argo CD docs: Application Specification Reference

Question 3

What does the RespectIgnoreDifferences sync option do?
  1. A.Applies the ignoreDifferences settings during a sync operation
  2. B.Prevents the sync from running at all whenever differences are detected between Git and the live state
  3. C.Ignores all differences between Git and live state, so the application always reports Synced
  4. D.Ignores deletion of resources, so nothing is ever pruned from the cluster during the sync

Correct answer: A

By default ignoreDifferences is only used when computing the diff, and the desired state is applied as-is during a sync. With RespectIgnoreDifferences=true the desired state is pre-patched, so ignored fields such as /spec/replicas are not overwritten by the sync. Why the other options are wrong. "Prevents the sync from running at all whenever differen...": the sync still runs, the option only changes how the patch is built. "Ignores all differences between Git and live state, so ...": only the fields listed in spec.ignoreDifferences are affected, not every difference. "Ignores deletion of resources, so nothing is ever prune...": pruning is controlled by Prune settings, unrelated to this option.

Sources: Argo CD docs: Sync Options, Argo CD docs: Diff Customization

Practice this topic

Focus mode keeps every question on Argo CD reconciliation patterns until you leave it. 10 free guest answers, then a free account; no credit card.

Or open CAPA practice across all topics.

Sources

The explanation above was checked against these official documents.