fluentd-elasticsearch
by phntom
A Fluentd Helm chart for Kubernetes with Elasticsearch output
About this chart
Fluentd Elasticsearch
- Installs Fluentd log forwarder.
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.
| Parameter | Description | Default |
|---|---|---|
affinity | Optional daemonset affinity | {} |
annotations | Optional daemonset annotations | NULL |
podAnnotations | Optional daemonset's pods annotations | NULL |
configMaps.useDefaults.systemConf | Use default system.conf | true |
configMaps.useDefaults.containersInputConf | Use default containers.input.conf | true |
configMaps.useDefaults.systemInputConf | Use default system.input.conf | true |
configMaps.useDefaults.forwardInputConf | Use default forward.input.conf | true |
configMaps.useDefaults.monitoringConf | Use default monitoring.conf | true |
configMaps.useDefaults.outputConf | Use default output.conf | true |
extraConfigMaps | Add additional Configmap or overwrite disabled default | {} |
awsSigningSidecar.enabled | Enable AWS request signing sidecar | false |
awsSigningSidecar.resources | AWS Sidecar resources | {} |
awsSigningSidecar.network.port | AWS Sidecar exposure port | 8080 |
awsSigningSidecar.network.address | AWS Sidecar listen address | localhost |
awsSigningSidecar.image.repository | AWS signing sidecar repository image | abutaha/aws-es-proxy |
awsSigningSidecar.image.tag | AWS signing sidecar repository tag | 0.9 |
elasticsearch.auth.enabled | Elasticsearch Auth enabled | false |
elasticsearch.auth.user | Elasticsearch Auth User | "" |
elasticsearch.auth.password | Elasticsearch Auth Password | "" |
elasticsearch.bufferChunkLimit | Elasticsearch buffer chunk limit | 2M |
elasticsearch.bufferQueueLimit | Elasticsearch buffer queue limit | 8 |
elasticsearch.host | Elasticsearch Host | elasticsearch-client |
elasticsearch.logstashPrefix | Elasticsearch Logstash prefix | logstash |
elasticsearch.port | Elasticsearch Port | 9200 |
elasticsearch.path | Elasticsearch Path | "" |
elasticsearch.scheme | Elasticsearch scheme setting | http |
elasticsearch.sslVerify | Elasticsearch Auth SSL verify | true |
elasticsearch.sslVersion | Elasticsearch tls version setting | TLSv1_2 |
elasticsearch.typeName | Elasticsearch type name | _doc |
elasticsearch.logLevel | Elasticsearch global log level | info |
env | List of env vars that are added to the fluentd pods | {} |
fluentdArgs | Fluentd args | --no-supervisor -q |
secret | List of env vars that are set from secrets and added to the fluentd pods | [] |
extraVolumeMounts | Mount extra volume, required to mount ssl certificates when ES has tls enabled | [] |
extraVolume | Extra volume | [] |
hostLogDir.varLog | Specify where fluentd can find var log | /var/log |
hostLogDir.dockerContainers | Specify where fluentd can find logs for docker container | /var/lib/docker/containers |
hostLogDir.libSystemdDir | Specify where fluentd can find logs for lib Systemd | /usr/lib64 |
image.repository | Image | quay.io/fluentd_elasticsearch/fluentd |
image.tag | Image tag | v2.9.0 |
image.pullPolicy | Image pull policy | IfNotPresent |
image.pullSecrets | Image pull secrets | `` |
livenessProbe.enabled | Whether to enable livenessProbe | true |
livenessProbe.initialDelaySeconds | livenessProbe initial delay seconds | 600 |
livenessProbe.periodSeconds | livenessProbe period seconds | 60 |
livenessProbe.kind | livenessProbe kind | Set to a Linux compatible command |
nodeSelector | Optional daemonset nodeSelector | {} |
podSecurityPolicy.annotations | Specify pod annotations in the pod security policy | {} |
podSecurityPolicy.enabled | Specify if a pod security policy must be created | false |
priorityClassName | Optional PriorityClass for pods | "" |
prometheusRule.enabled | Whether to enable Prometheus prometheusRule | false |
prometheusRule.prometheusNamespace | Namespace for prometheusRule | monitoring |
prometheusRule.labels | Optional labels for prometheusRule | {} |
rbac.create | RBAC | true |
resources.limits.cpu | CPU limit | 100m |
resources.limits.memory | Memory limit | 500Mi |
resources.requests.cpu | CPU request | 100m |
resources.requests.memory | Memory request | 200Mi |
service | Service definition | {} |
service.ports | List of service ports dict [{name:...}...] | Not Set |
service.ports[].type | Service type (ClusterIP/NodePort) | ClusterIP |
service.ports[].name | One of service ports name | Not Set |
service.ports[].port | Service port | Not Set |
service.ports[].nodePort | NodePort port (when service.type is NodePort) | Not Set |
service.ports[].protocol | Service protocol(optional, can be TCP/UDP) | Not Set |
serviceAccount.create | Specifies whether a service account should be created. | true |
serviceAccount.name | Name of the service account. | "" |
serviceAccount.annotations | Specify annotations in the pod service account | {} |
serviceMetric.enabled | Generate the metric service regardless of whether serviceMonitor is enabled. | false |
serviceMonitor.enabled | Whether to enable Prometheus serviceMonitor | false |
serviceMonitor.port | Define on which port the ServiceMonitor should scrape | 24231 |
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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartfluentd-elasticsearch is pinned at v11.8.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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