Sync policies & self-heal
Auto-sync, prune, self-heal.
By default an OutOfSync app waits for a manual sync. A syncPolicy with automated turns on continuous delivery: Argo CD syncs automatically whenever Git changes. Two options refine it. prune deletes resources that were removed from Git (without it, deleting a manifest leaves the object orphaned in the cluster). selfHeal reverts live drift back to Git. Together, automated + prune + selfHeal make the cluster strictly track Git — the fullest GitOps posture.
spec:syncPolicy:automated:prune: true # delete resources removed from GitselfHeal: true # revert out-of-band drift back to GitsyncOptions:- CreateNamespace=true- ApplyOutOfSyncOnly=trueretry:limit: 5backoff: { duration: 5s, factor: 2, maxDuration: 3m }
Choosing a posture per environment
The right policy varies by environment. Dev often runs fully automated with prune and self-heal for immediate, hands-off updates. Production frequently uses manual (or automated without self-heal) so a human confirms the sync, plus required PR approvals upstream — because auto-syncing prod means a merge deploys instantly with no second gate. The safety of GitOps comes from the Git review; auto-sync removes the deploy-time gate, so lean on branch protection and approvals to compensate.