Last active
September 21, 2022 14:43
-
-
Save mikerodionov/f49d563d2ece1e8f977de966fde64851 to your computer and use it in GitHub Desktop.
Scale down all Kubernetes deployments except specified
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
# This script will scale down all deployments except for specified in grep condition | |
kubectl get deploy -n NAMESPACE-NAME | grep -v 'deploymentA\|deploymentB\|deploymentC' | awk '{print $1}' | while read line; do | |
#echo $line | |
kubectl scale deploy $line --replicas=0 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment