Skip to content

Instantly share code, notes, and snippets.

@ltupin
Last active October 6, 2021 15:05
Show Gist options
  • Save ltupin/14681e58846086ef9806fd1e3b908610 to your computer and use it in GitHub Desktop.
Save ltupin/14681e58846086ef9806fd1e3b908610 to your computer and use it in GitHub Desktop.
Delete a rebellious namespace
kubectl get namespace {namespace_name} -o json > tmp.json

# vi the file and REMOVE FINALIZER BLOCK

# Kube way
kubectl replace --raw "/api/v1/namespaces/{namespace_name}/finalize" -f ./tmp.json

# Geeky way:
kubectl proxy
curl -H "Content-Type: application/json" -X PUT --data-binary @tmp.json http://localhost:8001/api/v1/namespaces/{namespace_name}/finalize
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment