Created
February 10, 2022 15:14
-
-
Save GustavoAmerico/c3719094778ddfb25016efb936e5bc6e to your computer and use it in GitHub Desktop.
Scale all deployment from namespace on single line, this command should be used for scale down dev and hmo env on day off
This file contains 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
param( | |
[Parameter(Mandatory=$true)][System.String] $namespace, | |
[Parameter(Mandatory=$true)][int]$numberOfReplicas | |
) | |
kubectl get deployments -n $namespace --output jsonpath="{range .items[*]}{.metadata.name}{'\n'}{end}" |%{ | |
kubectl scale deployment/$_ -n $namespace --replicas $numberOfReplicas; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment