Created
July 11, 2024 16:37
-
-
Save guitarrapc/8849a0595061baaff5d0ad67043753d9 to your computer and use it in GitHub Desktop.
Restart deployments for all namesapces
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 | |
for nsfull in $(kubectl get ns -o name | grep -v -E "kube.*"); do | |
ns=$(echo $nsfull | cut -d "/" -f 2) | |
deploy="" | |
echo "# Running $ns" | |
for deploy in $(kubectl get deploy -o name | grep -E ".*"); do | |
if [[ "$deploy" == "" ]]; then | |
continue | |
fi | |
kubectl rollout restart $deploy -n $ns | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment