Configuration in configmap of fluentd is not getting added in /fluentd/etc/fluent.conf file

9/12/2019

I am trying to use fluentd as a daemonSet which will run on a node where my application pods are running and convert the application logs into the stdout, So that it can be used to send to elastic search.

I created a configmap to load/add the extra configuration in fluent.conf but when I saw the logs of a daemon set it shows the config file contents where my entries from configmap is not present.

My configmap is like below:

apiVersion: v1
kind: ConfigMap
metadata:
  name: fluentd-config
  namespace: kube-system
data:
  fluentd.conf: |
    <source>
      type tail
      format none
      read_from_head true
      path /var/log/node1/app.log
      pos_file /var/log/node1/app.log.pos
      tag noappTag
    </source>
    <match **>
      type stdout
    </match>

But still, I am not able to see my contents. Is this normal behavior?

If not, then how can I confirm that fluentd is able to convert my application logs written into file into STDOUT.

/var/log/node1/app.log

is available inside the fluentd pod. I went inside and checked.

-- Nish
elasticsearch
fluentd
kubernetes
kubernetes-helm

1 Answer

9/12/2019

Your have configured this configmap in pod settings ?? If not then please configure configmap setting in pod.yaml file as a volume or env variables.

-- vaibhav kharode
Source: StackOverflow