My configuration is to upload an Image from CircleCI to ECR, catch the changes in Codepipeline and deploy to ECS.
At that time, an error occurs when deploying to ECS.
service dev-test was unable to place a task because no container instance met all of its requirements. The closest matching container-instance xxxxxxxx has insufficient CPU units available. For more information, see the Troubleshooting section of the Amazon ECS Developer Guide.
I can expect that the task cannot be executed due to lack of CPU, but this error does not occur when deploying from CircleCI to ECS or deploying manually.
What is the solution to this problem?
Also, I don’t know if this is related to this issue, but I have AutoScaling set to 2 for minimum and 4 for maximum, but AutoScaling is not running even though there is not enough CPU, and I get an error.
Is this problem also related to this issue?
2
Answers
Your
ECS Task
is too big and cannot fit on the EC2 instance. Try creating a new revision of the task with more CPU and memoryThis sounds like you have configured ECS Service autoscaling. The error is that you don’t have an EC2 instance registered with the cluster that has available space to run the task. You need to configure a cluster capacity provider with an EC2 auto-scaling group in order for ECS to automatically add EC2 instances to the cluster when they are needed.