2

I am running one AWS ECS Service with two tasks (they are 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 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:

  • Minimum healthy percent 50
  • Maximum percent 200

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?

asked Jan 21, 2021 at 18:01

1 Answer 1

1

You may scale up the instance size to allow for a rolling deployment or kill the existing tasks to make place for the new container to run. Another solution is to change your deployment config so that the minimum healthy is 50% and Maximum percent 100%, this kill a task before starting a new one.

answered Jan 21, 2021 at 20:17
Sign up to request clarification or add additional context in comments.

1 Comment

Hi, minimum to 50 and max to 100 is exactly what I had configured.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.