Skip to content

Instantly share code, notes, and snippets.

@kelsin
Last active February 27, 2021 05:36
Show Gist options
  • Save kelsin/25d3888ee2158e13af11be6e1365a9be to your computer and use it in GitHub Desktop.
Save kelsin/25d3888ee2158e13af11be6e1365a9be to your computer and use it in GitHub Desktop.
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