Toshi
Toshi

Reputation: 6360

Collect stdout/stderr logs with sidecar container

I use company originated cloud environment which doesn't allow us to use node log collector and asks us to use a sidecar container to ship logs to ELK. However our container prints all the logs to stdout/stderr by following the 12 factor app practice.

Is there any way to collect stdout/stderr logs using a sidecar container (Prefered to use Filebeat)? I was checking documentation but it's not clearly mentioned anywhere.

There's another way in which I print all the logs to the specific directory within app container and share the volume with the sidecar Filebeat container. However, with this approach, I should think about the log rotation as well, which introduces more complexity. (Probably I need to create another container to aggregate logs and rotate logs.)


I think the recommended approach could be

Upvotes: 1

Views: 1283

Answers (1)

P Ekambaram
P Ekambaram

Reputation: 17689

Consider one of the below options

  1. Deploy Fluentd daemonset to collect the logs from all pods from a node

OR

  1. Deploy Fluent-bit daemonset to collect logs and get it forward to Fluentd pod

Configure Fluentd pod to push the logs to Elasticsearch.

Upvotes: 0

Related Questions