How to configure a filebeat daemon set to handle multiple logging templates

5/21/2019

We have an app that is deployed on open shift and we use filebeat as a daemon set to collect the container logs and send them to elastic-search. The problem is that we have different logging templates. So I was wondering if there is a way to configure multiple filebeat configurations for the same daemonset deployment instead of deploying a daemonset for every logging template.

-- Karim Tarek
cloud
devops
kubernetes
openshift
redhat

1 Answer

5/21/2019

I think it need to create each daemonset for each template. But you can control where the daemonset should run using nodeSelector.

For example, you have 2 templates and each template should apply different nodes. Then you would create 2 daemonset configured as different node labels and logging templates.

node1 log=template1 ---> daemonset1 with "nodeSelector: log=template1"
node2 log=template1 ---> daemonset1 with "nodeSelector: log=template1"
node3 log=template2 ---> daemonset2 with "nodeSelector: log=template2"

I hope it help you.

-- Daein Park
Source: StackOverflow