I have ECS cluster configured on EC2 instances which has a set of services running in it. I’ve configured AWS Firelens sidecar container to route the ECS container logs to AWS Data firehose.
As per my current setup I have the sidecar container running for each and every ECS service in the cluster.
Lets say, If I have 3 services running, I have 3 sidecar containers running for log routing.
Is there any way were I can just have one sidecar container which can get the logs from all the containers running in the cluster?
Thanks.
2
Answers
No, the sidecar needs to be running in the same ECS task as the containers generating the logs.
ECS does support daemonsets though. In that case you would have one log container for each EC2 instance.
Here is an article from AWS about using Fluent Bit as a log daemon: https://aws.amazon.com/blogs/opensource/centralized-container-logging-fluent-bit/
Not sure about AWS Firelens though