#NOTE: This file is for reference purpose only. apiVersion: v1 kind: ConfigMap metadata: name: fluentd-config namespace: default data: # conf files under data section will override exisiting conf files. # Update the conf incase any default configuration is changed. prometheus.conf: |- # Prometheus metric exposed on 0.0.0.0:24231/metrics @type prometheus @id in_prometheus bind "#{ENV['FLUENTD_PROMETHEUS_BIND'] || '0.0.0.0'}" port "#{ENV['FLUENTD_PROMETHEUS_PORT'] || '24231'}" metrics_path "#{ENV['FLUENTD_PROMETHEUS_PATH'] || '/metrics'}" hostname ${hostname} #This plugin collects internal metrics for output plugin in Fluentd. #This is similar to prometheus_monitor plugin, but specialized for output plugin. #There are Many metrics prometheus_monitor does not include, such as num_errors, retry_wait and so on. @type prometheus_output_monitor @id in_prometheus_output_monitor hostname ${hostname} #This plugin collects internal metrics in Fluentd. @type prometheus_monitor hostname ${hostname} #This plugin collects internal metrics for in_tail plugin in Fluentd. in_tail plugin holds internal state for files that the plugin is watching. #The state is sometimes important to monitor plugins work correctly. @type prometheus_tail_monitor hostname ${hostname} tail_container_parse.conf: |- @type "#{ENV['FLUENT_CONTAINER_TAIL_PARSER_TYPE'] || 'json'}" time_format "#{ENV['FLUENT_CONTAINER_TAIL_PARSER_TIME_FORMAT'] || '%Y-%m-%dT%H:%M:%S.%NZ'}" systemd.conf: |- # Logs from systemd-journal for interesting services. @type systemd @id in_systemd_kubelet matches [{ "_SYSTEMD_UNIT": "kubelet.service" }] @type local persistent true path /var/log/fluentd-journald-kubelet-cursor.json fields_strip_underscores true read_from_head true tag kubelet # Logs from docker-systemd @type systemd @id in_systemd_docker matches [{ "_SYSTEMD_UNIT": "docker.service" }] @type local persistent true path /var/log/fluentd-journald-docker-cursor.json fields_strip_underscores true read_from_head true tag docker.systemd # Logs from systemd-journal for interesting services. @type systemd @id in_systemd_bootkube matches [{ "_SYSTEMD_UNIT": "bootkube.service" }] @type local persistent true path /var/log/fluentd-journald-bootkube-cursor.json fields_strip_underscores true read_from_head true tag bootkube kubernetes.conf: |- @include kubernetes/cluster-autoscaler.conf @include kubernetes/containers.conf @include kubernetes/docker.conf @include kubernetes/etcd.conf @include kubernetes/glbc.conf @include kubernetes/kube-apiserver-audit.conf @include kubernetes/kube-apiserver.conf @include kubernetes/kube-controller-manager.conf @include kubernetes/kube-proxy.conf @include kubernetes/kube-scheduler.conf @include kubernetes/kubelet.conf @include kubernetes/rescheduler.conf @include kubernetes/salt.conf @include kubernetes/startupscript.conf @type kubernetes_metadata @id filter_kube_metadata kubernetes_url "#{ENV['FLUENT_FILTER_KUBERNETES_URL'] || 'https://' + ENV.fetch('KUBERNETES_SERVICE_HOST') + ':' + ENV.fetch('KUBERNETES_SERVICE_PORT') + '/api'}" verify_ssl "#{ENV['KUBERNETES_VERIFY_SSL'] || true}" ca_file "#{ENV['KUBERNETES_CA_FILE']}" skip_labels "#{ENV['FLUENT_KUBERNETES_METADATA_SKIP_LABELS'] || 'false'}" skip_container_metadata "#{ENV['FLUENT_KUBERNETES_METADATA_SKIP_CONTAINER_METADATA'] || 'false'}" skip_master_url "#{ENV['FLUENT_KUBERNETES_METADATA_SKIP_MASTER_URL'] || 'false'}" skip_namespace_metadata "#{ENV['FLUENT_KUBERNETES_METADATA_SKIP_NAMESPACE_METADATA'] || 'false'}" watch "#{ENV['FLUENT_KUBERNETES_WATCH'] || 'true'}" fluent.conf: |- @include "#{ENV['FLUENTD_SYSTEMD_CONF'] || 'systemd'}.conf" @include "#{ENV['FLUENTD_PROMETHEUS_CONF'] || 'prometheus'}.conf" @include kubernetes.conf @include conf.d/*.conf # Enable if elasticsearch active instance is present # # @type elasticsearch # @id out_es # @log_level info # include_tag_key true # host "#{ENV['FLUENT_ELASTICSEARCH_HOST']}" # port "#{ENV['FLUENT_ELASTICSEARCH_PORT']}" # path "#{ENV['FLUENT_ELASTICSEARCH_PATH']}" # scheme "#{ENV['FLUENT_ELASTICSEARCH_SCHEME'] || 'http'}" # ssl_verify "#{ENV['FLUENT_ELASTICSEARCH_SSL_VERIFY'] || 'true'}" # ssl_version "#{ENV['FLUENT_ELASTICSEARCH_SSL_VERSION'] || 'TLSv1_2'}" # user "#{ENV['FLUENT_ELASTICSEARCH_USER'] || use_default}" # password "#{ENV['FLUENT_ELASTICSEARCH_PASSWORD'] || use_default}" # reload_connections "#{ENV['FLUENT_ELASTICSEARCH_RELOAD_CONNECTIONS'] || 'false'}" # reconnect_on_error "#{ENV['FLUENT_ELASTICSEARCH_RECONNECT_ON_ERROR'] || 'true'}" # reload_on_failure "#{ENV['FLUENT_ELASTICSEARCH_RELOAD_ON_FAILURE'] || 'true'}" # log_es_400_reason "#{ENV['FLUENT_ELASTICSEARCH_LOG_ES_400_REASON'] || 'false'}" # logstash_prefix "#{ENV['FLUENT_ELASTICSEARCH_LOGSTASH_PREFIX'] || 'logstash'}" # logstash_dateformat "#{ENV['FLUENT_ELASTICSEARCH_LOGSTASH_DATEFORMAT'] || '%Y.%m.%d'}" # logstash_format "#{ENV['FLUENT_ELASTICSEARCH_LOGSTASH_FORMAT'] || 'true'}" # index_name "#{ENV['FLUENT_ELASTICSEARCH_LOGSTASH_INDEX_NAME'] || 'logstash'}" # target_index_key "#{ENV['FLUENT_ELASTICSEARCH_TARGET_INDEX_KEY'] || use_nil}" # type_name "#{ENV['FLUENT_ELASTICSEARCH_LOGSTASH_TYPE_NAME'] || 'fluentd'}" # include_timestamp "#{ENV['FLUENT_ELASTICSEARCH_INCLUDE_TIMESTAMP'] || 'false'}" # template_name "#{ENV['FLUENT_ELASTICSEARCH_TEMPLATE_NAME'] || use_nil}" # template_file "#{ENV['FLUENT_ELASTICSEARCH_TEMPLATE_FILE'] || use_nil}" # template_overwrite "#{ENV['FLUENT_ELASTICSEARCH_TEMPLATE_OVERWRITE'] || use_default}" # sniffer_class_name "#{ENV['FLUENT_SNIFFER_CLASS_NAME'] || 'Fluent::Plugin::ElasticsearchSimpleSniffer'}" # request_timeout "#{ENV['FLUENT_ELASTICSEARCH_REQUEST_TIMEOUT'] || '5s'}" # application_name "#{ENV['FLUENT_ELASTICSEARCH_APPLICATION_NAME'] || use_default}" # suppress_type_name "#{ENV['FLUENT_ELASTICSEARCH_SUPPRESS_TYPE_NAME'] || 'true'}" # enable_ilm "#{ENV['FLUENT_ELASTICSEARCH_ENABLE_ILM'] || 'false'}" # ilm_policy_id "#{ENV['FLUENT_ELASTICSEARCH_ILM_POLICY_ID'] || use_default}" # ilm_policy "#{ENV['FLUENT_ELASTICSEARCH_ILM_POLICY'] || use_default}" # ilm_policy_overwrite "#{ENV['FLUENT_ELASTICSEARCH_ILM_POLICY_OVERWRITE'] || 'false'}" # # flush_thread_count "#{ENV['FLUENT_ELASTICSEARCH_BUFFER_FLUSH_THREAD_COUNT'] || '8'}" # flush_interval "#{ENV['FLUENT_ELASTICSEARCH_BUFFER_FLUSH_INTERVAL'] || '5s'}" # chunk_limit_size "#{ENV['FLUENT_ELASTICSEARCH_BUFFER_CHUNK_LIMIT_SIZE'] || '2M'}" # queue_limit_length "#{ENV['FLUENT_ELASTICSEARCH_BUFFER_QUEUE_LIMIT_LENGTH'] || '32'}" # retry_max_interval "#{ENV['FLUENT_ELASTICSEARCH_BUFFER_RETRY_MAX_INTERVAL'] || '30'}" # retry_forever true # # @type stdout @id out_prometheus flush_thread_count 8 flush_interval 5s chunk_limit_size 2M queue_limit_length 32 retry_max_interval 30 retry_forever true