Last active
September 26, 2025 19:57
-
-
Save mike-weiner/fab69be11ee1fce26e0cdfe675866264 to your computer and use it in GitHub Desktop.
Snippet to trigger a rolling restart of all deployments in a namespace.
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
| # This snippet is used to do a rolling restart on all Kubernetes | |
| # deployments in a namespace. | |
| # Replace `<NAMESPACE>` with your desired namespace. | |
| NS=<NAMESPACE> | |
| kubectl get deployments -n "$NS" -o name | grep -v "<EXCLUDE-THIS-DEPLOYMENT>" | while read -r d; do | |
| kubectl rollout restart -n "$NS" "$d" | |
| sleep 0.1 | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment