Created
October 28, 2021 12:40
-
-
Save iamcryptoki/596d580f4221a8b9f2839f1459922d21 to your computer and use it in GitHub Desktop.
Delete Kubernetes namespaces stuck at terminating.
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
| for ns in $(kubectl get ns --field-selector status.phase=Terminating -o jsonpath='{.items[*].metadata.name}'); do kubectl get ns $ns -ojson | jq '.spec.finalizers = []' | kubectl replace --raw "/api/v1/namespaces/$ns/finalize" -f -; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment