You can also use v1-debian-PLUGIN tag to refer latest v1 image, e.g. v1-debian-elasticsearch. On production, strict tag is better to avoid unexpected update.
See dockerhub's tags page for older tags.
Old stable
v0.12 development has been ended. These images are never updated.
Default YAML uses latest v1 images like fluent/fluentd-kubernetes-daemonset:v1-debian-kafka. If you want to avoid unexpected image update, specify exact version for image like fluent/fluentd-kubernetes-daemonset:v1.8.0-debian-kafka-1.0.
Run as root
This is for v0.12 images.
In Kubernetes and default setting, fluentd needs root permission to read logs in /var/log and write pos_file to /var/log.
To avoid permission error, you need to set FLUENT_UID environment variable to 0 in your Kubernetes configuration.
Use your configuration
These images have default configuration and support some environment variables for parameters
but it sometimes doesn't fit your case. If you want to use your configuration, use ConfigMap feature.
Each image has following configurations:
fluent.conf: Destination setting, Elaticsearch, kafka and etc.
kubernetes.conf: k8s specific setting. tail input for log files and kubernetes_metadata filter
tail_container_parse.conf: parser setting for /var/log/containers/*.log. See also "Use CRI parser for containerd/cri-o" logs section
prometheus.conf: prometheus plugin for fluentd monitoring
systemd.conf: systemd plugin for collecting systemd-journal log. See also "Disable systemd input" section.
Overwrite conf file via ConfigMap. See also several examples:
By default, these images use json parser for /var/log/containers/ files because docker generates json formatted logs.
On the other hand, containerd/cri-o use different log format. To parse such logs, you need to use cri parser instead.
You can use cri parser by overwriting tail_container_parse.conf via ConfigMap.
# configuration example
<parse>
@type cri
</parse>
Use FLUENT_CONTAINER_TAIL_PATH to change container logs folder
You can update the default path for the container logs i.e /var/log/container/*.log and also one can add multiple path as defined in this fluentd document https://docs.fluentd.org/input/tail#path
Use FLUENT_CONTAINER_TAIL_EXCLUDE_PATH to exclude specific container logs
Since v1.9.3 or later images.
You can exclude container logs from /var/log/containers/ with FLUENT_CONTAINER_TAIL_EXCLUDE_PATH.
If you have a trouble with specific log, use this envvar, e.g. ["/var/log/containers/logname-*"].
If you don't setup systemd in the container, fluentd shows following messages by default configuration.
[warn]: #0 [in_systemd_bootkube] Systemd::JournalError: No such file or directory retrying in 1s
[warn]: #0 [in_systemd_kubelet] Systemd::JournalError: No such file or directory retrying in 1s
[warn]: #0 [in_systemd_docker] Systemd::JournalError: No such file or directory retrying in 1s
You can suppress these messages by setting disable to FLUENTD_SYSTEMD_CONF environment variable in your kubernetes configuration.
Disable prometheus input plugins
By default, latest images launch prometheus plugins to monitor fluentd.
You can disable prometheus input plugin by setting disable to FLUENTD_PROMETHEUS_CONF environment variable in your kubernetes configuration.
Disable sed execution on elasticsearch image
This is for older images. Latest elasticsearch images don't use sed.
By historical reason, elasaticsearch image executes sed command during startup phase when FLUENT_ELASTICSEARCH_USER or FLUENT_ELASTICSEARCH_PASSWORD is specified. This sometimes causes a problem with read only mount.
To avoid this problem, set "true" to FLUENT_ELASTICSEARCH_SED_DISABLE environment variable in your kubernetes configuration.
Running on OpenShift
This daemonset setting mounts /var/log as service account fluentd so you need to run containers as privileged container.
Here is command example:
Using debian-kafka2/debian-kafka2-arm64 images are better than using debian-kafka/debian-kafka-arm64 images.
Because debian-kafka2/debian-kafka2-arm64 images use out_kafka2 plugin but debian-kafka/debian-kafka-arm64 images use deprecated out_kafka_buffered plugin.
Maintainers
Some images are contributed by users. If you have a problem/question for following images, ask it to contributors.
azureblob : @elsesiy
papertrail : @alexouzounis
kafka : @erhudy
graylog : @rtnpro
gcs : @andor-pierdelacabeza
Amazon Kinesis : @shiftky
logz.io : @SaMnCo / @jamielennox
splunkhec: @FutureSharks
Currently, we don't accept new destination request without contribution.
See #293
请发表评论