Skip to content

Instantly share code, notes, and snippets.

@darth-veitcher
Last active January 15, 2020 22:18
Show Gist options
  • Save darth-veitcher/613dd4556cd34dd8d5425f093a4765c0 to your computer and use it in GitHub Desktop.
Save darth-veitcher/613dd4556cd34dd8d5425f093a4765c0 to your computer and use it in GitHub Desktop.
Kubernetes Force Delete a Terminating Namespace
export NS=stucked-namespace
kubectl get namespace $NS -o json \
            | tr -d "\n" | sed "s/\"finalizers\": \[[^]]\+\]/\"finalizers\": []/" \
            | 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