argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.43k stars 5.3k forks source link

Set default deletion propagation policy for all apps #10834

Open pjankovsky opened 1 year ago

pjankovsky commented 1 year ago

Summary

I'd like to be able to set the default deletion propagation policy for all apps. Even better would be to set the default on a project or application level directly.

Motivation

Some services we deploy are critical enough that we would like to default deletion propagation policy to "non-cascading". When removing those services, we'd rather remove them from ArgoCD first, then perform cleanup via kubectl.

I could also see this being used by others to default to "background" if needed for a particular service.

There is also an ask to change the default behavior without a setting, but I think allowing a setting would be more flexible: #5724

Proposal

For a global setting, I think it could be a new key application.defaultDeletePolicy in the argocd-cm ConfigMap. For project or application level, it could also be a new key defaultDeletePolicy in the individual spec.

Habulinec commented 11 months ago

This would be a very-nice-to-have feature. Subscribed!

BenCoughlan15 commented 6 months ago

could we get the option to set the PropagationPolicy policy?

I'm not so worried about foreground in dev, but in production this will kill live transactions for us.