Paul Bastide

Engineering the World


kube ns delete stuck in terminating

Per https://www.ibm.com/docs/en/cloud-private/3.2.0?topic=console-namespace-is-stuck-in-terminating-state, you can delete the Namespace stuck in the Terminating Phase.

Recipe

1. Grab the namespace json

oc get namespace ma-operator -o json > tmp.json

2. Edit tmp.json to remove the finalizer

3. Start the proxy

oc proxy &

4. Delete the namespace

curl -k -H "Content-Type: application/json" -X PUT --data-binary @tmp.json http://127.0.0.1:8001/api/v1/namespaces/ma-operator/finalize