Created
October 22, 2020 11:18
-
-
Save chrisedrego/5ded371e3cd8d0c2be14f4b2c668dd71 to your computer and use it in GitHub Desktop.
force delete namespace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl proxy & | |
echo "Entering the namespace details: " | |
read ns | |
cat<<EOF >./ns.json | |
{ | |
"apiVersion": "v1", | |
"kind": "Namespace", | |
"metadata": { | |
"labels": { | |
"name": "$ns" | |
}, | |
"name": "$ns" | |
}, | |
"spec": { | |
"finalizers": [ | |
] | |
} | |
} | |
EOF | |
kubectl delete ns/$ns & | |
curl -k -H "Content-Type: application/json" -X PUT --data-binary @ns.json http://127.0.0.1:8001/api/v1/namespaces/$ns/finalize | |
kilall kubectl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment