Last active
February 27, 2021 05:36
-
-
Save kelsin/25d3888ee2158e13af11be6e1365a9be to your computer and use it in GitHub Desktop.
Restart all deployments in a k8s cluster
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
# When ready to do it for real, remove the "echo" | |
kubectl get deployments --all-namespaces | \ | |
tail -n +2 | \ | |
awk '{print $1, $2}' | \ | |
while read ns dep; do \ | |
echo kubectl rollout restart -n $ns deploy/$dep; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment