fluentd-elasticsearch

by kfirfer

Helm chartv13.9.1App v4.2.3

A Fluentd Helm chart for Kubernetes with Elasticsearch output

About this chart

Fluentd Elasticsearch

TL;DR

helm repo add kokuwa https://kokuwaio.github.io/helm-charts
helm install kokuwa/fluentd-elasticsearch

Introduction

This chart bootstraps a Fluentd daemonset on a Kubernetes cluster using the Helm package manager.

It's meant to be a drop in replacement for fluentd-gcp on GKE which sends logs to Google Stackdriver, but can also be used in other places where logging to ElasticSearch is required.

The used Docker image (Dockerfile) also contains the following plugins:

Prerequisites

  • Kubernetes 1.16+ with Beta APIs enabled

Installing the Chart

To install the chart with the release name my-release:

helm install --name my-release kokuwa/fluentd-elasticsearch

The command deploys fluentd-elasticsearch on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Uninstalling the Chart

To uninstall the my-release deployment:

helm uninstall my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the Fluentd elasticsearch chart and their default values.

ParameterDescriptionDefault
affinityOptional daemonset affinity{}
annotationsOptional daemonset annotationsNULL
podAnnotationsOptional daemonset's pods annotationsNULL
securityContextOptional a security context for a Pod{}
configMaps.useDefaults.systemConfUse default system.conftrue
configMaps.useDefaults.containersInputConfUse default containers.input.conftrue
configMaps.useDefaults.containersKeepTimeKeyKeep the container log timestamp as part of the log data.false
configMaps.useDefaults.kubernetesMetadataFilterConfigSet arbitrary configuration key-value pairs for the kubernetes_metadata filter.{}
configMaps.useDefaults.systemInputConfUse default system.input.conftrue
configMaps.useDefaults.forwardInputConfUse default forward.input.conftrue
configMaps.useDefaults.monitoringConfUse default monitoring.conftrue
configMaps.useDefaults.outputConfUse default output.conftrue
extraConfigMapsAdd additional Configmap or overwrite disabled default{}
elasticsearch.auth.enabledElasticsearch Auth enabledfalse
elasticsearch.auth.userElasticsearch Auth Usernull
elasticsearch.auth.passwordElasticsearch Auth Passwordnull
elasticsearch.auth.existingSecret.nameName of secretnull
elasticsearch.auth.existingSecret.keyKey within secret containing passwordnull
elasticsearch.setOutputHostEnvVarUse elasticsearch.hosts (Disable this to manually configure hosts)true
elasticsearch.hostsElasticsearch Hosts List (host and port)["elasticsearch-client:9200"]
elasticsearch.includeTagKeyElasticsearch Including of Tag keytrue
elasticsearch.logstash.enabledElasticsearch Logstash enabled (supersedes indexName)true
elasticsearch.logstash.prefixElasticsearch Logstash prefixlogstash
elasticsearch.logstash.prefixSeparatorElasticsearch Logstash prefix separator-
elasticsearch.logstash.dateformatElasticsearch Logstash strftime format to generate index target index name%Y.%m.%d
elasticsearch.ilm.enabledElasticsearch Index Lifecycle Management enabledfalse
elasticsearch.ilm.policy_idElasticsearch ILM policy IDlogstash-policy
elasticsearch.ilm.policyElasticsearch ILM policy to create{}
elasticsearch.ilm.policiesElasticsearch ILM policies to create, map of policy IDs and policies{}
elasticsearch.ilm.policy_overwriteElastichsarch ILM policy overwritefalse
elasticsearch.template.enabledElastichsarch Template enabledfalse
elasticsearch.template.nameElastichsarch Template Namefluentd-template
elasticsearch.template.fileElasticsearch Template FileName (inside the daemonset)fluentd-template.json
elasticsearch.template.contentElasticsearch Template Contentsee values.yaml
elasticsearch.template.overwriteElasticsearch Template Overwrite (update even if it already exists)false
elasticsearch.template.useLegacyUse legacy Elasticsearch templatetrue
elasticsearch.indexNameElasticsearch Index Namefluentd
elasticsearch.pathElasticsearch Path""
elasticsearch.schemeElasticsearch scheme settinghttp
elasticsearch.sslVerifyElasticsearch Auth SSL verifytrue
elasticsearch.sslVersionElasticsearch tls version settingTLSv1_2
elasticsearch.outputTypeElasticsearch output typeelasticsearch
elasticsearch.typeNameElasticsearch type name_doc
elasticsearch.logLevelElasticsearch global log levelinfo
elasticsearch.log400ReasonElasticsearch Log 400 reasonfalse
elasticsearch.reconnectOnErrorElasticsearch Reconnect on errortrue
elasticsearch.reloadOnFailureElasticsearch Reload on failurefalse
elasticsearch.reloadConnectionsElasticsearch reload connectionsfalse
elasticsearch.requestTimeoutElasticsearch request timeout5s
elasticsearch.suppressTypeNameElasticsearch type name suppression (for ES >= 7)false
elasticsearch.includeTimestampElasticsearch Include timestamp (param used only if logstash is disabled)false
elasticsearch.buffer.enabledElasticsearch Buffer enabledtrue
elasticsearch.buffer.chunkKeysElasticsearch Buffer comma-separated chunk keys""
elasticsearch.buffer.typeElasticsearch Buffer typefile
elasticsearch.buffer.pathElasticsearch Buffer path/var/log/fluentd-buffers/kubernetes.system.buffer
elasticsearch.buffer.flushModeElasticsearch Buffer flush modeinterval
elasticsearch.buffer.retryTypeElasticsearch Buffer retry typeexponential_backoff
elasticsearch.buffer.flushThreadCountElasticsearch Buffer flush thread count2
`elasticsearch.b

Deploy fluentd-elasticsearch with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has fluentd-elasticsearch on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartfluentd-elasticsearch is pinned at v13.9.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply