diff --git a/README.md b/README.md index 6c18b48..cfb2acd 100644 --- a/README.md +++ b/README.md @@ -336,9 +336,15 @@ sed -e 's|stun://|stun://:3479|' -i /etc/persistent/cfg/mg or kubectl run -it --rm busybox --restart=Never --image=busybox:1.28 -- nslookup api.github.com [-debug] [fqdn] -* Delete namespaces stuck in `Terminating` state: +* Delete namespaces stuck in `Terminating` state: + *First* check whether there are any resources still present; preventing the namespace from being deleted: + kubectl api-resources --verbs=list --namespaced -o name \ + | xargs -n 1 kubectl get --show-kind --ignore-not-found -n - kubectl get namespace -o json | jq -j '.spec.finalizers=null' > tmp.json - kubectl replace --raw "/api/v1/namespaces//finalize" -f ./tmp.json + Any resources returned should be deleted first (worth mentioning: if you get an error `error: unable to retrieve the complete list of server APIs`, you should check `kubectl get apiservice` for any apiservice with a status of `False`) + If there are no resources left in the namespace, and it is still stuck *terminating*, the following commands remove the blocking finalizer (this is a last resort, you are bypassing protections put in place to prevent zombie processes): + + kubectl get namespace -o json | jq -j '.spec.finalizers=null' > tmp.json + kubectl replace --raw "/api/v1/namespaces//finalize" -f ./tmp.json rm ./tmp.json