From the course: Debugging Kubernetes

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Removing finalizers from namespaces

Removing finalizers from namespaces - Kubernetes Tutorial

From the course: Debugging Kubernetes

Removing finalizers from namespaces

- [Instructor] Now, the approach we've seen for deleting finalizers works for almost every resource, except namespaces. Deleting namespace finalizers is slightly more complicated. Let's see what I mean here. Run kubectl get ns to see the namespaces in our folder. You'll see a namespace called delete-me, which is very suggestive. I think we should just delete it, so let's go ahead and delete it. You'll now see that that namespace is stuck in a deleting state. However, just like our pesky pod, this namespace is stuck also. Now, given that we just scanned the API resources in our cluster and confirmed that nothing else is waiting on this namespace, we could try to remove it by running kubectl init ns delete-me. Find the finalizer, remove it, save and quit. You can see that nothing's changed and our namespace is still waiting to be deleted over here. The only way to remove the finalizer from a namespace is to use the Kubernetes API directly. To do that, we'll need to obtain five pieces of…

Contents