Last active
August 20, 2020 20:10
-
-
Save DSdatsme/669abd616148f5d729958f9d3a4e7535 to your computer and use it in GitHub Desktop.
this oneliner will scale down your all deployments except the regex specified in if condition in the specific 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
| for i in $(kubectl get deploy -n <namespace> -o name); do if [[ ${i} != (*"mongodb"*|*"mysql"*) ]];then kubectl scale -n <namespace> --replicas 0 $i; fi; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment