Back to results for “Sync Waves & Hooks”
ArgoCD › Applications

What does the prune option do in a sync policy?

Intermediate

Answer

Prune deletes live resources that no longer exist in Git, keeping the cluster exactly matching the desired state. Without prune, removing a manifest from Git leaves the resource running (orphaned). Prune is powerful but should be used carefully; resources can be protected from pruning with annotations.
syncPolicy:
  automated:
    prune: true
# Protect a resource from pruning:
metadata:
  annotations:
    argocd.argoproj.io/sync-options: Prune=false
Real-world example After a service is deleted from Git, prune removes its Deployment and Service from the cluster automatically.

Common follow-ups: What happens without prune? | How do you protect a resource from pruning?