1. Preface
I was using Kubernetes and had a problem with a Kubernetes NameSpace not being deleted properly.
The NameSpace status had been in Terminating for quite a while, and I decided to force the NameSpace to be deleted.
2. Steps
1. View the existing NameSpace
2. try to force delete NameSpace
After executing the command stuck for a long time but no effect. It seems that it can not be deleted, you have to force the deletion
3. Get the NameSpace information that needs to be forcibly deleted
|
|
4. delete finalizers related content
5. running kube-proxy
6. Forced deletion of NameSpace via API
Run a new terminal and call the API to delete the NameSpace.
|
|
7. Shut down kube-proxy and make sure the NameSpace is deleted
Press CTRL-C
to close kube-proxy, and then confirm the current NameSpace.
You can see that NameSpace has been forcibly deleted.