By using AWS re:Post, you agree to the AWS re:Post Terms of Use

ECS with EC2 no working auto-scaling

0

I have an ECS cluster using EC2 infrastructure, and currently, I have a single desired EC2 instance. I know that a maximum of four tasks can be created per instance. However, when I set up task auto-scaling to a maximum desired count of eight tasks, I encounter an error when trying to create the fifth task because the EC2 instance doesn't have more capacity. Yet, it never creates a second EC2 instance to accommodate more tasks starting from the fifth one. The CapacityProviderReservation of the cluster always remains at 100%, despite allowing the necessary time. What could be the issue?

Enter image description here

Enter image description here

Enter image description here

Enter image description here

1 Answer
1

Was the instance in the ASG before configuring the capacity provider? If so, then the CapacityProvider might not be counting it. If you run an InstanceRefresh on the ASG, it will replace the existing instance and replace it with a new one, which should be correctly associated with the capacity provider. You'll want to make sure Managed Draining is enabled on the Capacity Provider (or some other draining solution is setup) to avoid downtime during instance replacement

AWS
EXPERT
answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions