Last active
May 24, 2024 18:33
-
-
Save xoanmi/5e12e0b3f90d1a62a721a2b3ba4122ed to your computer and use it in GitHub Desktop.
How to delete multiple kubernetes finalizers
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 | |
# https://kubernetes.io/blog/2021/05/14/using-finalizers-to-control-deletion/ | |
RESOURCES=$(kubectl get ns --no-headers -o custom-columns=":metadata.name") | |
for n in $RESOURCES | |
do | |
kubectl patch ns $n \ | |
--type json \ | |
--patch='[ { "op": "remove", "path": "/metadata/finalizers" } ]' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
kubectl get sth. --no-headers -o name
then
do kubectl patch $n