Lesson 3 of 9 · 26m
Argo CD Sync, Drift, and Ownership
Read Argo CD health and sync status accurately, use automated sync without surprises, and control who owns drift across applications.
Argo CD's interface is seductive because it makes operations visible. That visibility is also dangerous: operators start clicking Sync and Refresh before understanding whether the application is drifted, degraded, or simply waiting on a dependency. Argo CD rewards precise reading. The UI is a control surface, not a dashboard ornament.
An Application is a scope of ownership
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata: {name: checkout-api, namespace: argocd}
spec:
project: commerce
source:
repoURL: https://github.com/SudoSecurityOrg/platform.git
targetRevision: main
path: clusters/prod/checkout-api
destination: {server: https://kubernetes.default.svc, namespace: checkout}
syncPolicy:
automated: {prune: true, selfHeal: true}
syncOptions:
- CreateNamespace=trueThis says Argo CD owns the rendered resources under that path for that destination. It does not mean Argo CD owns every object in the namespace, and it definitely does not mean humans own nothing. Boundaries are contractual.
OutOfSync is not the same as Degraded
An application can be Synced and Degraded because the desired resources exist but pods crash. It can be OutOfSync and Healthy because a replica count was changed manually while the application continues serving. Treat sync status and health as separate axes:
Healthy Degraded
Synced intended and working intended but failing
OutOfSync drifted but working drifted and failingThe response is different in each quadrant. A degraded synced application needs application debugging. A healthy out-of-sync application needs drift investigation before sync destroys the reason it is healthy.
selfHeal repairs writes, not design flaws
With selfHeal: true, Argo CD syncs live resources back toward Git when cluster state changes. That is useful against manual edits, but it can fight legitimate controllers. The classic example is horizontal pod autoscaling: if Git declares replicas: 3 and the HPA scales to 9, self-heal sees drift. Remove replicas from Git when the HPA owns them, or configure a targeted ignore. Do not ignore the entire Deployment because one field is delegated.
spec:
ignoreDifferences:
- group: apps
kind: Deployment
jsonPointers:
- /spec/replicasRefresh and sync answer different questions
argocd app get checkout-api --hard-refresh
argocd app diff checkout-api
argocd app sync checkout-api --pruneA refresh asks Argo CD to re-evaluate Git and cluster state. A sync performs writes. During incident response, many destructive mistakes begin when someone syncs to make a stale UI stop confusing them. Refresh first, diff second, sync only after ownership is understood.
Field notes
- Automated sync without
prunecreates resources but often leaves orphaned objects behind. - The UI diff can include normalization and ignore rules; use CLI diff when precision matters.
- Argo CD health for custom resources depends on health Lua scripts or known status conventions.
- Do not click sync on every red application during a cluster outage; you may amplify an already saturated API server.
- A manual sync is still automation-mediated. Record who approved it and why if it bypasses the normal pull-request flow.
Was this lesson helpful?