Bootstrap FreeKB - ArgoCD - Delete Application using the CLI
ArgoCD - Delete Application using the CLI

Updated:   |  ArgoCD articles

This assumes:

The argocd app list command can then be used to list the app you have created.

~]$ argocd app list
NAME                   CLUSTER                         NAMESPACE  PROJECT  STATUS     HEALTH   SYNCPOLICY  CONDITIONS  REPO                                       PATH    TARGET
openshift-gitops/demo  https://kubernetes.default.svc  default    default  OutOfSync  Missing  Manual      <none>      https://github.com/my_project/my_repo.git  python

 

The argocd app delete command can then be used to delete an application.

~]$ argocd app delete openshift-gitops/demo
Are you sure you want to delete 'openshift-gitops/demo' and all its resources? [y/n] y
application 'openshift-gitops/demo' deleted

 

By default, there will be an interactive prompt. The --yes flag can be used to disable the interactive prompt.

~]$ argocd app delete openshift-gitops/demo --yes
application 'openshift-gitops/demo' deleted

 

Or you can use the kubectl (Kubernetes) or oc (OpenShift) login command to log into the Kubernetes or OpenShift cluster that ArgoCD is running in and then use the auth can-i command can be used to determine if you have permission to list and delete an ArgoCD application.

~]$ oc login -u john.doe api.dev.openshift.example.com:6443

~]$ oc auth can-i list applications.argoproj.io
yes

~]$ oc auth can-i delete applications.argoproj.io
yes

 

Assuming you have permission to delete an application the kubectl (Kubernetes) or oc (OpenShift) get applications.argoproj.io command can be used to list the ArgoCD application.

~]$ oc get applications.argoproj.io --namespace <the namespace argocd is in, usually argocd or openshift-gitops>
NAME                               SYNC STATUS   HEALTH STATUS
my-app                             Synced        Healthy
hello-world
bad-app                            OutOfSync     Degraded

 

And then the kubectl (Kubernetes) or oc (OpenShfit) delete command can be used to delete the application.

oc delete applications.argoproj.io my-app --namespace <the namespace argocd is in, usually argocd or openshift-gitops>

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 27dc79 in the box below so that we can be sure you are a human.