It is impossible today to delete all application's resources but the application itself.
Often in dev environments, we need to "undeploy" an application but not to delete the actual application object. To permit our developers to start from scratch.
It could also occur in production if we have a breaking change where a rolling update is not possible.
We cannot have at the same time two pods with two different versions.
Add a function to delete all K8S objects within an application.
You can use recreate deploy strategy
But I agree we need this functionality.
Would using kubectl delete ... suffice in this case?
Just initially, I'm thinking that adding the ability to delete multiple objects at once (such as how we allow to sync multiple object at once) would be a more flexible approach than _just_ adding the ability to "undeploy". (For example, if you need to re-deploy you application you might not need to redeploy your ingress every time.) And since we already support individual object deletion, adding batch object deletion would still fit Argo's paradigms.
Hi guys,
@OmerKahani the recreate deploy strategy does not fit our needs as this "undeploy" should not be the main way to deploy our app.
@simster7 kubectl delete ... is a solution, but in order to do that we must:
argocd app get <app> -o json to get all k8s resources in our appkubectl delete <resource>Adding the ability to delete multiple objects at once should be great.
And if it fits Argo's paradigms, it looks like the way to go.
Regarding your example:
For example, if you need to re-deploy your application you might not need to redeploy your ingress every time
Our backend is composed of many applications and we decided to create one Argo application per application. It is not the way you thought ArgoCD apps?
You could do this using kubectl -n $APP_NAMESACE delete -l apps.kubernetes.io/instance=my-app.
Most helpful comment
You could do this using
kubectl -n $APP_NAMESACE delete -l apps.kubernetes.io/instance=my-app.