Menu

1 / 6

Will Argo CD auto-prune delete your namespace? How to prevent it with Prune=false and Delete=false

DEV Community: kubernetes·KYUNGHWAN KIM·1 day ago
#xY8xkW5o
#devtokubernetes#devto#dev#prune#namespace
Reading 0:00
15s threshold

If you searched "argocd deleted namespace", "argocd prune deleted my namespace" or "argocd prevent namespace deletion", run kubectl logs -n argocd sts/argocd-application-controller | grep "Adding resource result" . A Namespace that Argo CD has just deleted shows Pruned / pruned ; one that it skipped shows PruneSkipped / ignored (no prune) . The cause of the first: an Application with automated prune: true tracks its own Namespace (or a CRD), and that object's manifest dropped out of what Git renders, so the next automated sync deleted it with everything inside. The difference between the two results is one annotation on the object, argocd.argoproj.io/sync-options: Prune=false,Delete=false : Prune=false stops the prune, and Delete=false covers the other path, where an ApplicationSet deletes the Application and resources-finalizer.argocd.argoproj.io deletes the resources it tracks. On our cluster an audit found 8 production Namespaces and 23 CRDs exposed this way.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.