Skip to content

Instantly share code, notes, and snippets.

@getaaron
Created June 2, 2023 21:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save getaaron/7f2cd500e4eaf6405c7809e4688ae6e1 to your computer and use it in GitHub Desktop.
Save getaaron/7f2cd500e4eaf6405c7809e4688ae6e1 to your computer and use it in GitHub Desktop.
Restart multiple Kubernetes deployments by tag
# If you want to restart all k8s deployments by label (e.g. where appname=foo, team=bar, and environ=baz), you can
kubectl get deployments --selector=appname=foo,team=bar,environ=baz | tail -n +2 | cut -d ' ' -f 1 | xargs kubectl rollout restart deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment