Last active
February 27, 2021 05:36
Restart all deployments in a k8s cluster
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
# 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