<p>I've started experimenting with Argocd as part of my cluster setup and set it up to watch a test repo containing some yaml files for a small application I wanted to use for the experiment. While getting to know the system a bit, I broke the repo connection and instead of fixing it I decided that I had what I wanted, and decided to do a clean install with the intention of configuring it towards my actual project.</p>
<p>I pressed the button in the web UI for deleting the application, which got stuck. After which I read that adding <code>spec.syncPolicy.allowEmpty: true </code> and removing the <code>metadata.finalizers</code> declaration from the application yaml file. This did not allow me to remove the application resource.</p>
<p>I then ran an uninstall command with the official manifests/install.yaml as an argument, which cleaned up most resources installed, but left the application resource and the namespace. Command: <code>kubectl delete -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml</code></p>
<p>Have tried to use the kubectl delete application NAME <code>--force</code> flag and the <code>--cascade=orphans</code> flag on the application resource as well as on the argocd namespace itself. Now I have both of them stuck at terminating without getting any further.</p>
<p>Now I'm proper stuck as I can't reinstall the argocd in any way I know due to the resources and namespace being marked for deletion, and I'm at my wits end as to what else I can try in order to get rid of the dangling application resource.</p>
<p>Any and all suggestions as to what to look into is much appreciated.</p>

<p>If your problem is that the namespace cannot be deleted, the following two solutions may help you：</p>
<ol>
<li>Check what resources are stuck in the deletion process, delete these resources, and then delete ns</li>
<li>Edit the namespace of argocd, check if there is a finalizer field in the spec, delete that field and the content of the field</li>
</ol>
<p>Hopefully it helped you.</p>
