Skip to content

Instantly share code, notes, and snippets.

@JoooostB
Created January 15, 2024 15:07
Show Gist options
  • Save JoooostB/5e5216f073c6da4ad525b088c8ed7923 to your computer and use it in GitHub Desktop.
Save JoooostB/5e5216f073c6da4ad525b088c8ed7923 to your computer and use it in GitHub Desktop.
You've tried anything, and still can't delete one or multiple namespaces that are stuck in Terminating? Try this after starting a kubectl proxy instead:
for NAMESPACE in list of namespaces; do kubectl get namespace $NAMESPACE -o json |jq '.spec = {"finalizers":[]}' >${NAMESPACE}.json; curl -k -H "Content-Type: application/json" -X PUT --data-binary @${NAMESPACE}.json 127.0.0.1:8001/api/v1/namespaces/$NAMESPACE/finalize; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment