Skip to content

Instantly share code, notes, and snippets.

@zawyelwin
Last active April 20, 2020 04:55
Show Gist options
  • Save zawyelwin/d216d1a15e4f6358d8e71482b219eef3 to your computer and use it in GitHub Desktop.
Save zawyelwin/d216d1a15e4f6358d8e71482b219eef3 to your computer and use it in GitHub Desktop.
for ns in $(kubectl get ns --no-headers | awk '{print $1}');
do for deploy in $(kubectl -n $ns get deploy --no-headers --ignore-not-found | awk '{print $1}');
do kubectl -n $ns scale deploy $deploy --replicas=1; done;
done;
for ns in $(kubectl get ns --no-headers | awk '{print $1}');
do for sts in $(kubectl -n $ns get sts --no-headers --ignore-not-found | awk '{print $1}');
do kubectl -n $ns scale sts $sts --replicas=1; done;
done;
for i in $(kubectl get deploy -n namespace | awk '{print $1}'); do kubectl scale --replicas=1 deploy -n namespace $i; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment