Created
January 4, 2022 15:12
-
-
Save tanmay-bhat/5a5db35c32da7750af4b58398ae930de to your computer and use it in GitHub Desktop.
Shell script to restart all deployments in all namespace except kube-system
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
| #!/bin/bash | |
| #if any namespace needs to be excluded, add that in grep section | |
| ns=$(kubectl get ns --no-headers | grep -Ev 'kube-system|kube-public' | cut -d ' ' -f1 ) | |
| for namespace in $ns; do | |
| kubectl -n $namespace rollout restart deploy | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment