Today, I tried to remove a namespace in Kubernetes, and after few minutes, it was blocked with Terminating status:
I searched on internet, and found this topic on Github:
https://github.com/kubernetes/kubernetes/issues/60807#issuecomment-572615776
So, I executed the following command:
1 |
kubectl get namespace "namespacetodelete" -o json | tr -d "\n" | sed "s/\"finalizers\": \[[^]]\+\]/\"finalizers\": []/" | kubectl replace --raw /api/v1/namespaces/namespacetodelete/finalize -f - |
Namespace has been removed:
I can now deploy namespace with the same name, without any problems.