Skip to content

Instantly share code, notes, and snippets.

@andreppires
Created October 15, 2019 12:53
Show Gist options
  • Save andreppires/f3288c21ea5d86dfa4f7de3b7601229e to your computer and use it in GitHub Desktop.
Save andreppires/f3288c21ea5d86dfa4f7de3b7601229e to your computer and use it in GitHub Desktop.
[Kubernetes Hacks] List of tools and command to save when I you are stuck
  • Delete a stucked namespace that is not deleted with grace-period=0 --force
(
NAMESPACE=your-rogue-namespace
kubectl proxy &
kubectl get namespace $NAMESPACE -o json |jq '.spec = {"finalizers":[]}' >temp.json
curl -k -H "Content-Type: application/json" -X PUT --data-binary @temp.json 127.0.0.1:8001/api/v1/namespaces/$NAMESPACE/finalize
)

Props to nobar: https://stackoverflow.com/a/53661717/6240029

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