eksctl-io / eksctl

The official CLI for Amazon EKS
https://eksctl.io
Other
4.89k stars 1.4k forks source link

[Help] The ASG provisioned EC2s in the same AZ. #7892

Closed laiminhtrung1997 closed 1 month ago

laiminhtrung1997 commented 2 months ago

I have configured the Auto Scaling Group (ASG) to provision EC2 instances with the capability type set to 'spot'. The desired, minimum, and maximum number of instances is set to 2, distributed across 3 Availability Zones (AZs) in the 'ap-northeast-1' region. The distribution of instances is as follows:

At one point, the EC2 spot instance in the 'ap-northeast-1a' AZ became unavailable. The ASG was unable to replace it with a new EC2 spot instance due to the unavailability of spot instances in both 'ap-northeast-1a' and 'ap-northeast-1d' AZs. After some time, with no available EC2 spot instances, the ASG provisioned an EC2 instance in the 'ap-northeast-1c' AZ, resulting in 2 EC2 instances in that AZ.

In my cluster, I have configured all the pods with affinity, anti-affinity, and topologySpreadConstraints to ensure that each pod is scheduled on a different node. However, when the above scenario occurred, only one pod was running, and the other pods were pending.

How can I configure the ASG to prevent it from provisioning EC2 instances in the same AZ?

image

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] commented 1 month ago

This issue was closed because it has been stalled for 5 days with no activity.