diff --git a/manager/generate_eks.py b/manager/generate_eks.py index dc1f680232..d09872f70f 100644 --- a/manager/generate_eks.py +++ b/manager/generate_eks.py @@ -61,6 +61,7 @@ def merge_override(a, b): def apply_worker_settings(nodegroup, config): worker_settings = { "name": "cx-wd-" + config["name"], + "asgSuspendProcesses": ["AZRebalance"], "labels": {"workload": "true"}, "taints": {"workload": "true:NoSchedule"}, "tags": { diff --git a/manager/install.sh b/manager/install.sh index 5dc13eec8e..0fde6dc268 100755 --- a/manager/install.sh +++ b/manager/install.sh @@ -151,8 +151,6 @@ function create_eks() { eksctl create cluster --timeout=$EKSCTL_TIMEOUT --install-neuron-plugin=false --install-nvidia-plugin=false -f /workspace/eks.yaml echo - suspend_az_rebalance - write_kubeconfig } @@ -310,22 +308,6 @@ function resize_nodegroup() { fi } -function suspend_az_rebalance() { - asg_on_demand_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-on-demand\`)]") - asg_on_demand_length=$(echo "$asg_on_demand_info" | jq -r 'length') - if (( "$asg_on_demand_length" > "0" )); then - asg_on_demand_name=$(echo "$asg_on_demand_info" | jq -r 'first | .AutoScalingGroupName') - aws autoscaling suspend-processes --region $CORTEX_REGION --auto-scaling-group-name $asg_on_demand_name --scaling-processes AZRebalance - fi - - 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_length=$(echo "$asg_spot_info" | jq -r 'length') - if (( "$asg_spot_length" > "0" )); then - asg_spot_name=$(echo "$asg_spot_info" | jq -r 'first | .AutoScalingGroupName') - aws autoscaling suspend-processes --region $CORTEX_REGION --auto-scaling-group-name $asg_spot_name --scaling-processes AZRebalance - fi -} - function setup_istio() { envsubst < manifests/istio-namespace.yaml | kubectl apply -f - >/dev/null