Created
June 14, 2019 11:06
-
-
Save microwaves/5c33080ffb7ce970eb37d7bfbe265903 to your computer and use it in GitHub Desktop.
remove a namespace stuck on terminating
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
# In the Master's shell execute: | |
curl -k -H "Content-Type: application/json" -XPUT --cacert /srv/kubernetes/ca.crt -H "Authorization: Bearer <token>" --data-binary @ns.json https://localhost/api/v1/namespaces/namespace-name/finalize | |
# The bearer token can be found in the file below, under 'admin': | |
sudo cat /srv/kubernetes/known_tokens.csv | |
# Content for ns.json: | |
{ | |
"kind": "Namespace", | |
"apiVersion": "v1", | |
"metadata": { | |
"name": "namespace-name", | |
"selfLink": "/api/v1/namespaces/namespace-name", | |
"annotations": { | |
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"annotations\":{},\"name\":\"namespace-name\"},\"spec\":{\"finalizers\":[\"foregroundDeletion\"]}}\n" | |
} | |
}, | |
"spec": { | |
"finalizers": [ | |
] | |
}, | |
"status": { | |
"phase": "Terminating" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment