Last active
January 15, 2025 15:59
-
-
Save rahulkj/2d3286c5282fc4f2ebce8ca42b4bb0ea to your computer and use it in GitHub Desktop.
Force delete namespace that is in termination state
This file contains hidden or 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
NAMESPACE=(servicebinding-system korifi-gateway korifi kpack cert-manager cf) | |
killall kubectl | |
for n in ${NAMESPACE[@]}; do | |
kubectl proxy & kubectl get namespace $n -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/$n/finalize | |
rm -rf temp.json | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment