Maven / ArgoCD interview questions
How does ArgoCD handle resource pruning and what risks does enabling it carry?
Resource pruning in ArgoCD refers to the automatic deletion of Kubernetes resources that exist in the cluster but are no longer present in the Git repository. When you sync an application with pruning enabled, ArgoCD compares the live cluster state against the desired Git state and removes any resources that have been deleted from Git.
By default, pruning is disabled. You enable it per sync operation via the CLI (argocd app sync <app> --prune) or by setting syncPolicy.automated.prune: true in the Application manifest for fully automated flows.
| Aspect | Detail |
|---|---|
| Accidental deletion | A mistaken removal from Git triggers permanent cluster deletion; rollback requires re-adding the resource and syncing. |
| Out-of-band resources | Resources created manually or by other controllers outside Git are pruned if ArgoCD tracks the namespace. |
| Cascading deletes | Pruning a parent resource (e.g., a Namespace) can cascade-delete child resources even if the children are still needed. |
| Finalizer loops | Resources with deletion finalizers may block sync and leave the application in a degraded state. |
To mitigate risk, use the argocd.argoproj.io/managed-by label carefully and consider combining pruning with Sync Windows to limit when automated pruning can fire. The PruneLast=true sync option instructs ArgoCD to delete resources only after all other sync steps complete successfully, reducing mid-sync inconsistency.
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- PruneLast=true
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
