【发布时间】:2020-01-21 00:19:14
【问题描述】:
我正在 ECS (Fargate) 上创建一个包含 3 个容器的任务,其中两个容器是必不可少的。而且我发现如果非必要容器启动失败,整个任务都会失败。是预期的吗?
在任务定义https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html中,它说:
If the essential parameter of a container is marked as true, and that container fails or stops for any reason, all other containers that are part of the task are stopped. If the essential parameter of a container is marked as false, then its failure does not affect the rest of the containers in a task. If this parameter is omitted, a container is assumed to be essential.
我已在我的主要容器和其他容器中将 essential 设置为 true 为 false。我想知道为什么这个标志在我的 ECS 中不起作用。
我知道,在大多数情况下,人们会为每个任务创建一个容器。就我而言,我在一项任务中有多个容器。我不考虑将容器移动到单独的任务中。我问我容器中的essential 没有按预期工作。
下面是我的任务定义的截图,你可以看到第一个容器不是必需的,这意味着它的失败不应该导致任务失败。
【问题讨论】:
标签: amazon-web-services amazon-ecs