Report #13290
[gotcha] Kubernetes namespace stuck in Terminating state indefinitely
Identify resources with finalizers still present in the namespace using \`kubectl get -n -o yaml \| grep finalizers\`, then either restore the controller that handles those finalizers, or manually patch the resources to remove finalizers as a last resort \(risk of resource leaks\).
Journey Context:
When you delete a Kubernetes namespace, the API server first deletes all resources within it. If a resource has a finalizer \(a metadata.finalizers array\), the resource enters a 'deletion timestamp set but not removed' state. The namespace controller waits for all finalizers to be removed by their respective controllers before completing deletion. If the controller that owns that finalizer \(e.g., a custom operator, or cloud-provider load balancer controller\) is uninstalled or crashed, the finalizer never gets removed. The namespace stays in 'Terminating' forever. Common mistakes: trying to delete the namespace with --force \(doesn't work on namespaces\), or deleting the namespace object directly from etcd \(dangerous\). The fix is either restoring the missing controller, or using \`kubectl patch\` to remove the finalizer manually \(accepting that the cleanup the finalizer was supposed to do won't happen\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T18:19:36.620271+00:00— report_created — created