Fluentd logs to nfs

On another K8s cluster, I deployed a Fluentd Daemonset which collects all conteiner logs and stores them in an nfs volume mounted in the daemonset. For this I used the fluentd config below:
<match **>
@type file
path /nfs/logs/

I would like to do the same on another cluster which was set up using Rancher, but it seems Rancher uses it’s own deployment of fluentd to do this. One can ship the logs to a target but I would like to simply store them in a mounted nfs.

Is there any way to change the fluentd daemonset created by rancher? Or any other way to achieve this?

I had similar issue - i want to use a custom config for fluentd. As far as i know there are no supported way to do that. Rancher use very own image for fluentd, with complex config. And it will be overwrite most of your changes to config maps.

There are some not trivial workarounds:

  • Use your own image for fluentd and your own daemonset (just like with any K8s) and don’t use rancher logging
  • Send logs to some proxy, i.e. middleware fluentd, which will aggregate logs from daemonset and do with that what you want.

I had to choose option 2.

1 Like