fluentd-elasticsearch

by phntom

Helm chartv11.8.3App 3.2.0

A Fluentd Helm chart for Kubernetes with Elasticsearch output

About this chart

Fluentd Elasticsearch

TL;DR

helm install kiwigrid/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's Stackdriver service, but can also be used in other places where logging to ElasticSearch is required. The used Docker image also contains Google's detect exceptions (for Java multiline stacktraces), Prometheus exporter, Kubernetes metadata filter & Systemd plugins.

Prerequisites

  • Kubernetes 1.8+ with Beta APIs enabled

Installing the Chart

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

helm install --name my-release kiwigrid/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/delete the my-release deployment:

helm delete 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
configMaps.useDefaults.systemConfUse default system.conftrue
configMaps.useDefaults.containersInputConfUse default containers.input.conftrue
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{}
awsSigningSidecar.enabledEnable AWS request signing sidecarfalse
awsSigningSidecar.resourcesAWS Sidecar resources{}
awsSigningSidecar.network.portAWS Sidecar exposure port8080
awsSigningSidecar.network.addressAWS Sidecar listen addresslocalhost
awsSigningSidecar.image.repositoryAWS signing sidecar repository imageabutaha/aws-es-proxy
awsSigningSidecar.image.tagAWS signing sidecar repository tag0.9
elasticsearch.auth.enabledElasticsearch Auth enabledfalse
elasticsearch.auth.userElasticsearch Auth User""
elasticsearch.auth.passwordElasticsearch Auth Password""
elasticsearch.bufferChunkLimitElasticsearch buffer chunk limit2M
elasticsearch.bufferQueueLimitElasticsearch buffer queue limit8
elasticsearch.hostElasticsearch Hostelasticsearch-client
elasticsearch.logstashPrefixElasticsearch Logstash prefixlogstash
elasticsearch.portElasticsearch Port9200
elasticsearch.pathElasticsearch Path""
elasticsearch.schemeElasticsearch scheme settinghttp
elasticsearch.sslVerifyElasticsearch Auth SSL verifytrue
elasticsearch.sslVersionElasticsearch tls version settingTLSv1_2
elasticsearch.typeNameElasticsearch type name_doc
elasticsearch.logLevelElasticsearch global log levelinfo
envList of env vars that are added to the fluentd pods{}
fluentdArgsFluentd args--no-supervisor -q
secretList of env vars that are set from secrets and added to the fluentd pods[]
extraVolumeMountsMount extra volume, required to mount ssl certificates when ES has tls enabled[]
extraVolumeExtra volume[]
hostLogDir.varLogSpecify where fluentd can find var log/var/log
hostLogDir.dockerContainersSpecify where fluentd can find logs for docker container/var/lib/docker/containers
hostLogDir.libSystemdDirSpecify where fluentd can find logs for lib Systemd/usr/lib64
image.repositoryImagequay.io/fluentd_elasticsearch/fluentd
image.tagImage tagv2.9.0
image.pullPolicyImage pull policyIfNotPresent
image.pullSecretsImage pull secrets``
livenessProbe.enabledWhether to enable livenessProbetrue
livenessProbe.initialDelaySecondslivenessProbe initial delay seconds600
livenessProbe.periodSecondslivenessProbe period seconds60
livenessProbe.kindlivenessProbe kindSet to a Linux compatible command
nodeSelectorOptional daemonset nodeSelector{}
podSecurityPolicy.annotationsSpecify pod annotations in the pod security policy{}
podSecurityPolicy.enabledSpecify if a pod security policy must be createdfalse
priorityClassNameOptional PriorityClass for pods""
prometheusRule.enabledWhether to enable Prometheus prometheusRulefalse
prometheusRule.prometheusNamespaceNamespace for prometheusRulemonitoring
prometheusRule.labelsOptional labels for prometheusRule{}
rbac.createRBACtrue
resources.limits.cpuCPU limit100m
resources.limits.memoryMemory limit500Mi
resources.requests.cpuCPU request100m
resources.requests.memoryMemory request200Mi
serviceService definition{}
service.portsList of service ports dict [{name:...}...]Not Set
service.ports[].typeService type (ClusterIP/NodePort)ClusterIP
service.ports[].nameOne of service ports nameNot Set
service.ports[].portService portNot Set
service.ports[].nodePortNodePort port (when service.type is NodePort)Not Set
service.ports[].protocolService protocol(optional, can be TCP/UDP)Not Set
serviceAccount.createSpecifies whether a service account should be created.true
serviceAccount.nameName of the service account.""
serviceAccount.annotationsSpecify annotations in the pod service account{}
serviceMetric.enabledGenerate the metric service regardless of whether serviceMonitor is enabled.false
serviceMonitor.enabledWhether to enable Prometheus serviceMonitorfalse
serviceMonitor.portDefine on which port the ServiceMonitor should scrape24231
serviceMonitor.interval

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 v11.8.3 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