Argo-cd: Undeploy applications

Created on 21 Oct 2019  路  4Comments  路  Source: argoproj/argo-cd

Summary

It is impossible today to delete all application's resources but the application itself.

Motivation

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.

Proposal

Add a function to delete all K8S objects within an application.

core enhancement usability workaround

Most helpful comment

You could do this using kubectl -n $APP_NAMESACE delete -l apps.kubernetes.io/instance=my-app.

All 4 comments

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:

  • run argocd app get <app> -o json to get all k8s resources in our app
  • then a for loop with kubectl 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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eroji picture eroji  路  3Comments

travis-sobeck picture travis-sobeck  路  3Comments

gregsheremeta picture gregsheremeta  路  3Comments

jessesuen picture jessesuen  路  3Comments

alexec picture alexec  路  3Comments