Skip to content

Instantly share code, notes, and snippets.

@hrittikhere
Created October 2, 2021 14:10
Show Gist options
  • Save hrittikhere/c07f00c6c9603bc57fc0202c276bfd1c to your computer and use it in GitHub Desktop.
Save hrittikhere/c07f00c6c9603bc57fc0202c276bfd1c to your computer and use it in GitHub Desktop.
Delete Terminating Namespace
kubectl get namespace "terminating-namespace" -o json \
| tr -d "\n" | sed "s/\"finalizers\": \[[^]]\+\]/\"finalizers\": []/" \
| kubectl replace --raw /api/v1/namespaces/terminating-namespace/finalize -f -
@pgvishnuram
Copy link

kubectl get namespace terminating-namespace -o json | jq '.spec.finalizers=[]' | kubectl replace --raw /api/v1/namespaces/terminating-namespace/finalize -f -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment