Skip to content

Instantly share code, notes, and snippets.

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