# Fluentd Helm Chart [Fluentd](https://www.fluentd.org/) is an open source data collector for unified logging layer. Fluentd allows you to unify data collection and consumption for a better use and understanding of data. ## Installation To add the `fluent` helm repo, run: ```sh helm repo add fluent https://fluent.github.io/helm-charts helm repo update ``` To install a release named `fluentd`, run: ```sh helm install fluentd fluent/fluentd ``` ## Chart Values ```sh helm show values fluent/fluentd ``` ## Value Details ### default-volumes The default configurations bellow are required for the fluentd pod to be able to read the hosts container logs. The second section is responsible for allowing the user to load the "extra" configMaps either defined by the `fileConfigs` contained objects or, in addition, loaded externally and indicated by `configMapConfigs`. ```yaml - name: varlog hostPath: path: /var/log - name: varlibdockercontainers hostPath: path: /var/lib/docker/containers --- - name: etcfluentd-main configMap: name: fluentd-main defaultMode: 0777 - name: etcfluentd-config configMap: name: fluentd-config defaultMode: 0777 ``` ### default-volumeMounts The default configurations bellow are required for the fluentd pod to be able to read the hosts container logs. They should not be removed unless for some reason your container logs are accessible through a different path ```yaml - name: varlog mountPath: /var/log - name: varlibdockercontainers mountPath: /var/lib/docker/containers readOnly: true ``` The section bellow is responsible for allowing the user to load the "extra" configMaps either defined by the `fileConfigs` contained objects or otherwise load externally and indicated by `configMapConfigs`. ```yaml - name: etcfluentd-main mountPath: /etc/fluent - name: etcfluentd-config mountPath: /etc/fluent/config.d/ ``` ### default-fluentdConfig The `fileConfigs` section is organized by sources -> filters -> destinations. Flow control must be configured using fluentd routing with tags or labels to guarantee that the configurations are executed as intended. Alternatively you can use numeration on your files to control the configurations loading order. ```yaml 01_sources.conf: |- @type tail @id in_tail_container_logs @label @KUBERNETES path /var/log/containers/*.log pos_file /var/log/fluentd-containers.log.pos tag kubernetes.* read_from_head true @type multi_format format json time_key time time_type string time_format "%Y-%m-%dT%H:%M:%S.%NZ" keep_time_key false format regexp expression /^(? emit_unmatched_lines true 02_filters.conf: |- 03_dispatch.conf: |- 04_outputs.conf: |- ``` ## Backwards Compatibility - v0.1.x The old fluentd chart used the ENV variables and the default fluentd container definitions to set-up automatically many aspects of fluentd. It is still possible to trigger this behaviour by removing this charts current `.Values.env` configuration and replace by: ```yaml env: - name: FLUENT_ELASTICSEARCH_HOST value: "elasticsearch-master" - name: FLUENT_ELASTICSEARCH_PORT value: "9200" ```