Last active
February 1, 2022 16:19
-
-
Save Gibby/9d3faf609e0d66e8b79f3ac13a64e4f3 to your computer and use it in GitHub Desktop.
Force kubernetes namespace - Use for when namespace 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 | |
NAMESPACE="foo" \ | |
kubectl get namespace "$NAMESPACE" -o json | tr -d "\n" | sed "s/\"finalizers\": \[[^]]\+\]/\"finalizers\": []/" | kubectl replace --raw /api/v1/namespaces/"$NAMESPACE"/finalize -f - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment