{{- if and .Values.forwarder.enabled (not .Values.forwarder.configMap) -}} apiVersion: v1 kind: ConfigMap metadata: name: {{ include "fluentd.fullname" . }}-forwarder-cm labels: {{- include "fluentd.labels" . | nindent 4 }} app.kubernetes.io/component: forwarder data: fluentd.conf: | {{- if .Values.metrics.enabled -}} # Prometheus Exporter Plugin # input plugin that exports metrics @type prometheus port {{ .Values.metrics.service.port }} # input plugin that collects metrics from MonitorAgent @type prometheus_monitor host ${hostname} # input plugin that collects metrics for output plugin @type prometheus_output_monitor host ${hostname} # input plugin that collects metrics for in_tail plugin @type prometheus_tail_monitor host ${hostname} {{- end }} # Ignore fluentd own events @type null # HTTP input for the liveness and readiness probes @type http port 9880 # Throw the healthcheck to the standard output instead of forwarding it @type stdout # Get the logs from the containers running in the node @type tail path /var/log/containers/*mco*.log # exclude Fluentd logs exclude_path /var/log/containers/*fluentd*.log pos_file /opt/bitnami/fluentd/logs/buffers/fluentd-docker.pos tag kubernetes.* read_from_head true @type json # enrich with kubernetes metadata @type kubernetes_metadata {{ if .Values.aggregator.enabled }} # Forward all logs to the aggregators @type forward {{- $fullName := (include "fluentd.fullname" .) }} {{- $global := . }} {{- $domain := default "cluster.local" .Values.clusterDomain }} {{- $port := .Values.aggregator.port | int }} {{- range $i, $e := until (.Values.aggregator.replicaCount | int) }} {{ printf "host %s-%d.%s-headless.%s.svc.%s" $fullName $i $fullName $global.Release.Namespace $domain }} {{ printf "port %d" $port }} {{- if ne $i 0 }} standby {{- end }} {{- end}} @type file path /opt/bitnami/fluentd/logs/buffers/logs.buffer flush_thread_count 2 flush_interval 5s {{- else }} # Send the logs to the standard output @type stdout {{- end -}} {{- end -}}