[ECS] Daemon services with awsvpc?

0

Is it possible to run daemon services with tasks using the the awsvpc networking mode?

I don't think it's possible given that each task using awsvpc would be treated as a separate instance (even if they're on the same EC2 instance), but wanted to double check as it seems kind of a waste to run multiple copies of my sidecars (cloudwatch, xray, etc.) on an EC2 instance.

If not possible, is there a workaround or recommendation to replicate the functionality of daemon services for tasks using awsvpc networking modes?

asked 2 years ago659 views
1 Answer
0
Accepted Answer

I haven't played with Daemons as of late but I don't see how the networking model would come in the way. The "each task using awsvpc would be treated as a separate instance" is true when it comes to the network stack as in the task will get a dedicated VPC address but the task will run on the container instance and so the property of REPLICA Vs. DAEMON are orthogonal to what model you use to connect those tasks.

AWS
EXPERT
answered 2 years ago
  • Thank you. I found the reference in the documentation (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking-awsvpc.html)

    When a task is started with the awsvpc network mode, the Amazon ECS container agent creates an additional pause container for each task before starting the containers in the task definition. It then configures the network namespace of the pause container by running the amazon-ecs-cni-plugins CNI plugins. The agent then starts the rest of the containers in the task so that they share the network stack of the pause container. This means that all containers in a task are addressable by the IP addresses of the ENI, and they can communicate with each other over the localhost interface.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions