Report #44751
[gotcha] Kubernetes namespace stuck in Terminating state indefinitely
Identify remaining resources with kubectl get -n -o json \| jq '.items\[\] \| select\(.metadata.finalizers \!= null\)', then patch to remove finalizers: kubectl patch / -p '\{"metadata":\{"finalizers":\[\]\}\}' --type=merge. Prevention: uninstall operators/CRDs before deleting namespace, or use Helm's --cascade=foreground.
Journey Context:
When you delete a namespace, Kubernetes sets a deletionTimestamp and runs pre-delete hooks. If any resource in the namespace has a finalizer \(e.g., foregroundDeletion, or custom finalizers from operators like external-secrets, cert-manager, or ingress-nginx\), Kubernetes blocks deletion until the controller removes the finalizer. If the controller pod was already deleted \(e.g., you deleted the operator namespace first, or scaled it down\), the finalizer remains forever. Users often try 'kubectl delete namespace --force' which doesn't work for namespaces \(it ignores grace period but not finalizers\). The only fix is manual patching. This is a common trap in CI/CD pipelines that teardown environments.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T05:35:00.252301+00:00— report_created — created