How to remove stuck "terminating" ns deletions
June 2, 2026
Situation
When deleting namespaces, like
kubectl delete ns test
for some reason when you show namespaces
kubectl get ns
the status was stuck in "terminating" despite rebooting server and cluster.
Found an article and a solution that worked. replace "test" with the NameSpaceName in the two locations in the command below:
kubectl get namespace test -o json | tr -d "\\n" | sed "s/\\"finalizers\\": \\[[^]]\\+\\]/\\"finalizers\\": []/" | kubectl replace --raw /api/v1/namespaces/test/finalize -f -
Source of solution --> https://stackoverflow.com/questions/52369247/namespace-stucked-as-terminating-how-i-removed-it