Report #7308
[gotcha] Kubernetes Namespace stuck in Terminating state indefinitely due to finalizers on resources
Identify remaining resources with \`kubectl api-resources --verbs=list --namespaced -o name \| xargs -n1 kubectl get -n --ignore-not-found\`, then patch/remove finalizers with \`kubectl patch -p '\{"metadata":\{"finalizers":\[\]\}\}' --type=merge\`. If the controller is gone, edit the namespace object directly to clear \`spec.finalizers\`.
Journey Context:
The Kubernetes namespace controller blocks deletion until all resources are garbage collected. Finalizers \(protection hooks on resources like PVCs, custom CRDs, or service mesh sidecars\) prevent resource deletion until an external controller acknowledges cleanup. If that controller pod was already deleted \(circular dependency\) or the CRD itself was removed, the finalizer remains orphaned. The namespace hangs in Terminating, and repeated \`kubectl delete\` calls fail silently. Force-deleting the namespace JSON without clearing finalizers leaves orphaned etcd entries and can cause controller inconsistencies. You must manually patch the finalizers to release the resources, or restore the missing controller temporarily.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T02:19:24.214918+00:00— report_created — created