containers-roadmap icon indicating copy to clipboard operation
containers-roadmap copied to clipboard

[ECS] [feature request]: Support container restart policy for bridge mode FireLens log router containers

Open sparrc opened this issue 1 year ago • 0 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Tell us about your request

Currently, when using the ECS FireLens feature there are two env vars set on the application container so that it can directly log to the fluent-bit log router container (ie, the container with the firelensConfiguration object) without using stdout: FLUENT_HOST and FLUENT_PORT. (see ECS doc for more details: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/firelens-docker-buffer-limit.html)

On the EC2 launch type in bridge network mode, the FLUENT_HOST env var is set to a dynamic IP address. This means that if the log router container has a restart policy, and it restarts, then it can get a new IP address, and the application container's FLUENT_HOST ip address will not be accurate anymore.

This means that writes from the application container to FLUENT_HOST can begin to fail after a restart of the FireLens log_router container.

Which service(s) is this request for? ECS/EC2

Are you currently working around this issue?

Don't write directly to FLUENT_HOST when using CRP on the log router container in bridge mode.

Additional context

This could be fixed by using user-defined networks: https://github.com/aws/containers-roadmap/issues/184, because agent could then set FLUENT_HOST to be a DNS name rather than an ip address.

sparrc avatar Sep 20 '24 22:09 sparrc