Created
February 20, 2020 19:23
-
-
Save nebril/4610c03b78137ed2bee4d2d13f55089c to your computer and use it in GitHub Desktop.
Delete all terminating namespaces in k8s cluster
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
kubectl get ns | grep Terminating | awk '{print $1}' | xargs -n 1 bash -c 'kubectl get ns -o json $1 | tr -d "\n" | sed "s/\"finalizers\": \[[^]]\+\]/\"finalizers\": []/" | kubectl replace --raw /api/v1/namespaces/$1/finalize -f -' - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment