I am creating a Task on ECS (Fargate) with 3 containers inside and two of the containers are essential. And I found if the non-essential container fail to start, the whole task will be failed. Is it expected?
In the task definition https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html, it says:
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.
I have set essential
to true
in my major container and other containers as false. I wonder why this flag doesn't work in my ECS.
I know that in most cases people create one container per task. My in my case, I have multiple containers in one task. I don't consider an option to move my containers to separate tasks. I am asking my the essential
in container doesn't work as expected.
Below is a screenshot of my task definition and you can see that the first container is not essential which means its failure shouldn't cause task failure.