Skip to content

Instantly share code, notes, and snippets.

@kanedafromparis
Created June 20, 2018 12:25
Show Gist options
  • Save kanedafromparis/57a849e6fa4a27fdf1deecf2eb3c9c8d to your computer and use it in GitHub Desktop.
Save kanedafromparis/57a849e6fa4a27fdf1deecf2eb3c9c8d to your computer and use it in GitHub Desktop.
TIMESLOT=`date +%y%m%d%H%M%S`;
for proj in $(oc get project --show-labels -l zone!=production,role!=webhop --no-headers | cut -d " " -f 1); do
for dc in $(oc get dc -n $proj --show-labels -l zone!=production,role!=webhop --no-headers | cut -d " " -f 1); do
#echo " dc $dc --replicas=0 -n $proj " | tee -a $TIMESLOT-scaledown.log;
oc scale dc $dc --replicas=0 -n $proj | tee -a $TIMESLOT-scaledown.log;
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment