Created
February 13, 2024 11:50
-
-
Save janeczku/697d3012fa67e2abafbaf0346999f03b to your computer and use it in GitHub Desktop.
Batch delete finalizers Kubernetes
This file contains hidden or 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 | |
N=20 | |
task(){ | |
kubectl patch -n hobbyfarm instances.ec2.cattle.io $1 \ | |
--type json \ | |
--patch='[ { "op": "remove", "path": "/metadata/finalizers" } ]' | |
} | |
RESOURCES=$(kubectl -n hobbyfarm get instances.ec2.cattle.io --no-headers -o custom-columns=":metadata.name") | |
for n in $RESOURCES | |
do | |
((i=i%N)); ((i++==0)) && wait | |
task "$n" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment