Last active
July 25, 2022 13:42
-
-
Save jujhars13/662821713182f790a72316bc4a342b0c to your computer and use it in GitHub Desktop.
deleting kubernetes namespaces that are stuck in "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
#!/bin/bash | |
# Thanks to https://medium.com/@craignewtondev/how-to-fix-kubernetes-namespace-deleting-stuck-in-terminating-state-5ed75792647e | |
# NB this can be dangerous, so use sparingly | |
export ns=broken-app; kubectl get ns "${ns}" -o json | sed s/\"kubernetes\"//g | kubectl replace --raw /api/v1/namespaces/"${ns}"/finalize -f - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment