Reorganize a bit logging-aggregator's fluentd conf files
With latest changes a few things don't work well anymore:
- the Helm value
filters
is not appropriately named anymore, since we now have custom pipelines as well - we mix "system" configuration from the log-forwarding chart with "user" configuration set with Helm values
- the fluentd configmap is a mix of templating and insertion of static files, this is a bit confusing and hard to trace
- "user" conf files include a "system" configuration file here - this is not ideal as this implies well-defined file names, i.e. some kind of interface
- the output file
cernmonit-output.conf
should be renamed because it's not necessarily sending to central monitoring. Justoutput.conf
?
Some ideas:
-
for 1/2/3, taking inspiration from upstream OKD3: separate "system" configuration from "user" configuration in different configmaps (and folders). All "system" configuration comes from static files. Rename
filters
to e.g.userConfigFiles
for "user" configuration. The one config file for output that needs to be templated should probably be inserted in the "user" configuration (since it's not static), but what about moving the template to a separate go template/tpl
file to help locate it? -
rename
dryRun
to something more explicit. While debugging, I had the feeling it would be useful to send to both central monitoring and stdout for troubleshooting. Sth likeenabledOutput: [ stdout, centralMonitoring ]
? Or 2 booleansoutputToStdout
outputToCentralMonitoring
? (less convenient I think, since we have to change 2 values to switch from default stdout to prod central monitoring output). To support multiple outputs, the output conf file template could so sth like this:
# output.conf template
<match **>
@type copy
{{ if outputToStdout }}
<store>
@include system/output-stdout.conf
</store>
{{ end }}
{{ if outputToCentralMonitoring }}
<store>
@include system/output-central-monitoring.conf
</store>
{{ end }}
</match>
- for 4, could we instead just use this?
<match **>
@type relabel
@label @OUTPUT
</match>