Skip to content

Instantly share code, notes, and snippets.

@initcron
Created April 25, 2021 09:21
Show Gist options
  • Save initcron/68678cb984d47535a59c1c5092ea5d61 to your computer and use it in GitHub Desktop.
Save initcron/68678cb984d47535a59c1c5092ea5d61 to your computer and use it in GitHub Desktop.
Delete a namespace which is pending termination due to a finalizer.
export PENDING_NAMESPACE=xxxxxx
kubectl get namespace $PENDING_NAMESPACE -o json | tr -d "\n" | sed "s/\"finalizers\": \[[^]]\+\]/\"finalizers\": []/" | kubectl replace --raw /api/v1/namespaces/$PENDING_NAMESPACE/finalize -f -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment