Skip to content

Instantly share code, notes, and snippets.

@sumanthkumarc
Created February 3, 2022 09:13
Show Gist options
  • Save sumanthkumarc/f1caf8ef4d59169646076d118829b506 to your computer and use it in GitHub Desktop.
Save sumanthkumarc/f1caf8ef4d59169646076d118829b506 to your computer and use it in GitHub Desktop.
namespace deletion
(
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
pkill -9 -f "kubectl proxy"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment