简体   繁体   中英

Where can i see which placementStrategy a service is using in AWS ECS?

I want to know which placementStrategy some of mye services in AWS Elastic Container Services (ECS) are using?

( https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html )

In the task definition it says:

Task Placement Constraint No constraints

But that is something else?

Not sure about console, but in CLI you can use describe-services . Among many other things, it returns:

placementStrategy -> (list)

    The placement strategy that determines how tasks for the service are placed.

    (structure)

        The task placement strategy for a task or service. For more information, see Task Placement Strategies in the Amazon Elastic Container Service Developer Guide .

        type -> (string)

            The type of placement strategy. The random placement strategy randomly places tasks on available candidates. The spread placement strategy spreads placement across available candidates evenly based on the field parameter. The binpack strategy places tasks on available candidates that have the least available amount of the resource that is specified with the field parameter. For example, if you binpack on memory, a task is placed on the instance with the least amount of remaining memory (but still enough to run the task).

        field -> (string)

            The field to apply the placement strategy against. For the spread placement strategy, valid values are instanceId (or host , which has the same effect), or any platform or custom attribute that is applied to a container instance, such as attribute:ecs.availability-zone . For the binpack placement strategy, valid values are cpu and memory . For the random placement strategy, this field is not used.

Task Placement strategies are defined in services and not in task definition. When you create a new service and configure it, you will get the option to define it, please check official doc https://docs.aws.amazon.com/AmazonECS/latest/developerguide/basic-service-params.html

Attaching the screenshot here to show the console section to use placement strategies

任务安置策略

To check the deployment strategy after that please check under task definition:任务定义-放置策略

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM