Search code examples
amazon-web-servicesamazon-ecs

ECS task definition for spread not binpack


How do I set a task definition to balance containers on different nodes instead of filling up one first (binpack).

I can set placement "constraints" in a task definition but I see no option for "spread"


Solution

  • You need to specify task placement strategy, not constraint. This can be done in create service or run task. Here's the AWS documentation on this - https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html