From 280b67be4e82a6de40acd5a6a7f617c1070cf8a6 Mon Sep 17 00:00:00 2001 From: vishal Date: Mon, 20 Jan 2020 15:14:27 -0500 Subject: [PATCH] Check spot asg before checking on_demand --- manager/install.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/manager/install.sh b/manager/install.sh index d43e5a198e..4a9e512c2a 100755 --- a/manager/install.sh +++ b/manager/install.sh @@ -85,7 +85,7 @@ function ensure_eks() { asg_spot_info=$(aws autoscaling describe-auto-scaling-groups --region $CORTEX_REGION --query "AutoScalingGroups[?contains(Tags[?Key==\`alpha.eksctl.io/cluster-name\`].Value, \`$CORTEX_CLUSTER_NAME\`)]|[?contains(Tags[?Key==\`alpha.eksctl.io/nodegroup-name\`].Value, \`ng-cortex-worker-spot\`)]") asg_spot_name=$(echo "$asg_spot_info" | jq -r 'first | .AutoScalingGroupName') - if [[ -n $asg_on_demand_name ]]; then + if [[ -z $asg_spot_name ]]; then asg_min_size=$(echo "$asg_on_demand_info" | jq -r 'first | .MinSize') asg_max_size=$(echo "$asg_on_demand_info" | jq -r 'first | .MaxSize') else @@ -93,7 +93,6 @@ function ensure_eks() { asg_max_size=$(echo "$asg_spot_info" | jq -r 'first | .MaxSize') fi - if [ "$asg_min_size" != "$CORTEX_MIN_INSTANCES" ]; then echo -n "○ updating min instances to $CORTEX_MIN_INSTANCES "