logstash
by Elastic Inc.
Official Elastic helm chart for Logstash
About this chart
Logstash Helm Chart
This Helm chart is a lightweight way to configure and run our official [Logstash Docker image][].
Warning When it comes to running the Elastic on Kubernetes infrastructure, we recommend [Elastic Cloud on Kubernetes][] (ECK) as the best way to run and manage the Elastic Stack.
ECK offers many operational benefits for both our basic-tier and our enterprise-tier customers, such as spinning up cluster nodes that were lost on failed infrastructure, seamless upgrades, rolling cluster changes, and much much more.
With the release of the Elastic Stack Helm charts for Elastic version 8.5.1, we are handing over the ongoing maintenance of our Elastic Stack Helm charts to the community and contributors. This repository will finally be archived after 6 months time. Elastic Stacks deployed on Kubernetes through Helm charts will still be fully supported under EOL limitations.
Since we want to provide an even better experience for our customers by running the Elastic Stack on Kubernetes, we will continue maintaining the Helm charts applicable to ECK Custom Resources. These charts can be found in the [ECK repository][eck-charts].
Helm charts will currently be maintained for ECK Enterprise-tier customers, however, we encourage the community to engage with the existing Helm charts for the Elastic Stack and continue supporting their ongoing maintenance.
See https://github.com/elastic/helm-charts/issues/1731 for more details.
- Requirements
- Installing
- Install a released version using the Helm repository
- Install a development version using the main branch
- Upgrading
- Usage notes
- Configuration
- FAQ
- How to install OSS version of Logstash?
- How to install plugins?
- Contributing
Requirements
See [supported configurations][] for more details.
Installing
Install a released version using the Helm repository
-
Add the Elastic Helm charts repo:
helm repo add elastic https://helm.elastic.co -
Install it:
helm install logstash elastic/logstash
Install a development version using the main branch
-
Clone the git repo:
git clone [email protected]:elastic/helm-charts.git -
Install it:
helm install logstash ./helm-charts/logstash --set imageTag=8.5.1
Upgrading
Please always check [CHANGELOG.md][] and [BREAKING_CHANGES.md][] before upgrading to a new chart version.
Usage notes
- This repo includes several [examples][] of configurations that can be used as a reference. They are also used in the automated testing of this chart
- Automated testing of this chart is currently only run against GKE (Google Kubernetes Engine).
- The chart deploys a StatefulSet and by default will do an automated rolling
update of your cluster. It does this by waiting for the cluster health to become
green after each instance is updated. If you prefer to update manually you can
set
OnDelete[updateStrategy][]. - It is important to verify that the JVM heap size in
logstashJavaOptsand to set the CPU/Memoryresourcesto something suitable for your cluster. - We have designed this chart to be very un-opinionated about how to configure Logstash. It exposes ways to set environment variables and mount secrets inside of the container. Doing this makes it much easier for this chart to support multiple versions with minimal changes.
logstash.ymlconfiguration files can be set either by a ConfigMap usinglogstashConfiginvalues.ymlor by environment variables usingextraEnvsinvalues.yml, however Logstash Docker image can't mix both methods as defining settings with environment variables causeslogstash.ymlto be modified in place while using ConfigMap bind-mount the same file (more details in this [note][]).- When overriding
logstash.yml,http.host: 0.0.0.0should always be included to make default probes work. If restricting HTTP API to 127.0.0.1 is required by usinghttp.host: 127.0.0.1, default probes should be disabled or overridden (see [values.yaml][] for the good syntax). - An ingress is provided that can be used to expose the HTTP port. This can be useful for the [http input plugin][], for instance.
Configuration
| Parameter | Description | Default |
|---|---|---|
antiAffinityTopologyKey | The [anti-affinity][] topology key]. By default this will prevent multiple Logstash nodes from running on the same Kubernetes node | kubernetes.io/hostname |
antiAffinity | Setting this to hard enforces the [anti-affinity][] rules. If it is set to soft it will be done "best effort". Other values will be ignored | hard |
envFrom | Templatable string to be passed to the [environment from variables][] which will be appended to the envFrom: definition for the container | [] |
extraContainers | Templatable string of additional containers to be passed to the tpl function | [] |
extraEnvs | Extra [environment variables][] which will be appended to the env: definition for the container | [] |
extraInitContainers | Templatable string of additional initContainers to be passed to the tpl function | [] |
extraPorts | An array of extra ports to open on the pod | [] |
extraVolumeMounts | Templatable string of additional volumeMounts to be passed to the tpl function | [] |
extraVolumes | Templatable string of additional volumes to be passed to the tpl function | [] |
fullnameOverride | Overrides the full name of the resources. If not set the name will default to " .Release.Name - .Values.nameOverride or .Chart.Name " | "" |
hostAliases | Configurable [hostAliases][] | [] |
httpPort | The http port that Kubernetes will use for the healthchecks and the service | 9600 |
imagePullPolicy | The Kubernetes [imagePullPolicy][] value | IfNotPresent |
imagePullSecrets | Configuration for [imagePullSecrets][] so that you can use a private registry for your image | [] |
imageTag | The Logstash Docker image tag | 8.5.1 |
image | The Logstash Docker image | docker.elastic.co/logstash/logstash |
labels | Configurable [labels][] applied to all Logstash pods | {} |
ingress | Configurable [ingress][] for external access to Logstash HTTP port. | see [values.yaml][] |
lifecycle | Allows you to add lifecycle configuration. See [values.yaml][] for an example of the formatting | {} |
livenessProbe | Configuration fields for the liveness [probe][] | see [values.yaml][] |
logstashConfig | Allows you to add any config files in /usr/share/logstash/config/ such as logstash.yml and log4j2.properties See [values.yaml][] for an example of the formatting | {} |
logstashJavaOpts | Java options for Logstash. This is where you should configure the JVM heap size | -Xmx1g -Xms1g |
logstashPipeline | Allows you to add any pipeline files in /usr/share/logstash/pipeline/ | {} |
logstashPatternDir | Allows you to define a custom directory to store pattern files | /usr/share/logstash/patterns/ |
logstashPattern | Allows you to add any pattern files in logstashPatternDir | {} |
maxUnavailable | The [maxUnavailable][] value for the pod disruption budget. By default this will prevent Kubernetes from having more than 1 unhealthy pod in the node group | 1 |
nameOverride | Overrides the chart name for resources. If not set the name will default to .Chart.Name | "" |
nodeAffinity | Value for the [node affinity setting |
Deploy logstash with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has logstash 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 chartlogstash is pinned at v8.5.1 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