Unable to delete resource: namespaces "default" is forbidden: this namespace may not be deleted #9634
-
While experimenting with argocd, I included the following resource in the git repo: apiVersion: v1
kind: Namespace
metadata:
name: default In retrospect, I just wanted to keep the namespace annotations and labels synched with my git repo. Now, I am unable to delete this resource from argocd because Kubernetes refuses the delete the default namespace. The yaml resource has been removed from the git repo, but I am unable to sync argocd. Is there a way to remove the resource reference from argocd without having to actually delete the resource from the cluster? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I guess to "unmanage" that resource, you would need to patch out the tracking label that Argo CD has applied to the live resource. Given a standard Argo CD configuration and that the resource was deleted in Git, you can run:
|
Beta Was this translation helpful? Give feedback.
-
Thank you! That does the trick and causes argocd to ignore the resource. Best regards! |
Beta Was this translation helpful? Give feedback.
-
I did it in the following way
|
Beta Was this translation helpful? Give feedback.
I guess to "unmanage" that resource, you would need to patch out the tracking label that Argo CD has applied to the live resource. Given a standard Argo CD configuration and that the resource was deleted in Git, you can run: