简体   繁体   English

在哪里可以查看服务在 AWS ECS 中使用的放置策略?

[英]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?我想知道 AWS Elastic Container Services (ECS) 中的一些 mye 服务使用的是哪个placementStrategy?

( https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-strategies.html ) 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 .不确定控制台,但在 CLI 中您可以使用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当您创建一个新服务并配置它时,您将获得定义它的选项,请查看官方文档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:要检查之后的部署策略,请检查任务定义:任务定义-放置策略

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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