Files
robot-shop/K8s/autoscaling/autoscale.sh
Steve Waterworth e5c10b597f autoscaling
2019-05-22 15:54:05 +01:00

15 lines
292 B
Bash
Executable File

#!/bin/sh
NS="robot-shop"
DEPLOYMENTS="cart catalogue dispatch payment ratings shipping user web"
for DEP in $DEPLOYMENTS
do
kubectl -n $NS autoscale deployment $DEP --max 2 --min 1 --cpu-percent 50
done
echo "Waiting 5 seconds for changes to apply..."
sleep 5
kubectl -n $NS get hpa