1

I am encountering a very weird issue. Every time when I try to create a new namespace using kubectl create namespace xx then when I try to delete it, the operation becomes stuck:

[root@k8s-master-node ~]# kubectl delete namespace xx2
namespace "xx2" deleted

If I press CTRL+C the namespace remains in Terminating state. Any ideas?

[root@k8s-master-node ~]# kubectl version
Client Version: version.Info{Major:"1", Minor:"23", GitVersion:"v1.23.1", GitCommit:"86ec240af8cbd1b60bcc4c03c20da9b98005b92e", GitTreeState:"clean", BuildDate:"2021-12-16T11:41:01Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.2", GitCommit:"8b5a19147530eaac9476b0ab82980b4088bbc1b2", GitTreeState:"clean", BuildDate:"2021-09-15T21:32:41Z", GoVersion:"go1.16.8", Compiler:"gc", Platform:"linux/amd64"}
DobreMihaela
  • 174
  • 1
  • 10
  • are there any resoures present on that namespace , please check ``` kubectl get all -n xx2 ``` . – confused genius Jan 06 '22 at 16:27
  • 1
    +1 to @confused-genius comment. I have seen this issue when I'm deploying CRDs with finalizers. If my Operator isn't running, the finalizers can't be run and deleting Namespaces sticks. – DazWilkin Jan 06 '22 at 17:59
  • Does this answer your question? [Kubernetes Namespaces stuck in Terminating status](https://stackoverflow.com/questions/52954174/kubernetes-namespaces-stuck-in-terminating-status) – Ivan Aracki Jan 14 '22 at 10:55
  • Use the command `kubectl describe namespace ` to see what resource blocks the termination process – Oberwalder Sven Aug 25 '23 at 11:31

0 Answers0