Skip to content

Commit aba1a99

Browse files
authored
Check spot asg before checking on_demand (#766)
1 parent 3bb2139 commit aba1a99

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

manager/install.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,14 @@ function ensure_eks() {
8585
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\`)]")
8686
asg_spot_name=$(echo "$asg_spot_info" | jq -r 'first | .AutoScalingGroupName')
8787

88-
if [[ -n $asg_on_demand_name ]]; then
88+
if [[ -z $asg_spot_name ]]; then
8989
asg_min_size=$(echo "$asg_on_demand_info" | jq -r 'first | .MinSize')
9090
asg_max_size=$(echo "$asg_on_demand_info" | jq -r 'first | .MaxSize')
9191
else
9292
asg_min_size=$(echo "$asg_spot_info" | jq -r 'first | .MinSize')
9393
asg_max_size=$(echo "$asg_spot_info" | jq -r 'first | .MaxSize')
9494
fi
9595

96-
9796
if [ "$asg_min_size" != "$CORTEX_MIN_INSTANCES" ]; then
9897
echo -n "○ updating min instances to $CORTEX_MIN_INSTANCES "
9998

0 commit comments

Comments
 (0)