The defining superpower of GitOps is Continuous Reconciliation. If someone makes an unauthorized manual change to the live cluster, ArgoCD automatically detects the drift and restores the cluster to match Git.
1. The Core Sync Options Explained
Inside the Application.spec.syncPolicy:
What is Pruning (prune: true)?
If you delete redis-service.yaml from your Git repository and push to main:
- With
prune: false: ArgoCD leaves the old Redis service running in Kubernetes as an orphan. - With
prune: true: ArgoCD detects the file was deleted from Git and automatically runskubectl delete service redis.
What is Self-Healing (selfHeal: true)?
If an engineer uses kubectl edit or kubectl delete to modify a running pod or service directly:
- With
selfHeal: false: ArgoCD marks the application asOutOfSync(yellow warning in UI), but takes no action. - With
selfHeal: true: ArgoCD immediately overrides the change and resets the cluster back to the exact YAML defined in Git within seconds!
2. Sync Waves: Controlling Deployment Order
What if your application requires a database schema migration to complete before the new API pods start?
ArgoCD Sync Waves control the exact order of resource creation using annotations:
3. Sync Windows: Protecting Production During Business Hours
You can configure Sync Windows to block automated deployments during high-traffic business hours or maintenance blackouts: