I am running one AWS ECS Service with two tasks (they are the same) and one container per task. I would like to know, how to properly manage rolling updates?
As per information, I found inside AWS docs, a rolling update is the default option.
Task and services are described inside Terraform and I do update via aws cli:
aws ecs update-service --cluster $(ECS_CLUSTER) --service $(ECS_SERVICE) --force-new-deployment --task-definition $(ECS_TASK_DEFINITION)
Task configuration: +-------------+---------+ | Task memory | 900 MiB | +-------------+---------+ | Task CPU | 900 | +-------------+---------+ Container configuration: +-------------+---------+ | CPU | 256 | +-------------+---------+ | Hard limit | 900 MiB | +-------------+---------+ | Soft limit | 512 MiB | +-------------+---------+
For this cluster, I have registered one t3a.small instance, so available resources are the following:
-
CPU: 2048 units
-
Memory: 1961 MiB
This is suitable for running two tasks, however, I am facing issues during deployment:
Service web was unable to place a task because no container instance met all of its requirements. The closest matching container instance 123123123 has insufficient CPU units available. For more information, see the Troubleshooting section.
Service deployment is configured like this:
So my guess was, one service will be killed and the other one will be updated, however, I am receiving this error instead.
How this should be configured correctly?