Report #38681
[gotcha] Kubernetes namespace stuck in Terminating state due to finalizers on Custom Resources
Before deleting a namespace containing CRDs with finalizers, first delete the custom resources themselves to allow controllers to remove finalizers; if the controller is already gone, manually patch the CRDs to remove finalizers: \`kubectl patch crd --type json -p '\[\{"op": "remove", "path": "/metadata/finalizers"\}\]'\`
Journey Context:
When \`kubectl delete namespace\` runs, Kubernetes deletes all resources concurrently. If a Custom Resource has a finalizer \(e.g., \`kubernetes.io/pvc-protection\`\), the API server blocks its deletion until the controller removes the finalizer. If the controller runs in that same namespace \(or was deleted first\), it cannot process the removal, creating a deadlock. The namespace hangs in 'Terminating' indefinitely. Users often try \`--force\` or \`--grace-period=0\`, which the API server ignores for namespace finalizers. The correct fix is foreground propagation \(delete children first\) or manual finalizer removal.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T19:24:12.806205+00:00— report_created — created