Skip to content

Instantly share code, notes, and snippets.

@smgoller
Created November 15, 2021 23:36
Show Gist options
  • Save smgoller/ac2f01d1b25d8c519497932e12cac473 to your computer and use it in GitHub Desktop.
Save smgoller/ac2f01d1b25d8c519497932e12cac473 to your computer and use it in GitHub Desktop.
How to remove all finalizers from a namespace
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