Skip to content

Instantly share code, notes, and snippets.

@queil
Created October 13, 2020 13:41
Show Gist options
  • Save queil/737591c1ba372234c5c256f0beb18c29 to your computer and use it in GitHub Desktop.
Save queil/737591c1ba372234c5c256f0beb18c29 to your computer and use it in GitHub Desktop.
Delete Kubernetes namespace that gets stuck in finalizing
# first must run kubectl proxy in a separate terminal
kubectl proxy
# then run this (replace delete-me)
kubectl get ns delete-me -o json | \
jq '.spec.finalizers=[]' | \
curl -X PUT http://localhost:8001/api/v1/namespaces/delete-me/finalize -H "Content-Type: application/json" --data @-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment