elasticsearch

by Elastic Inc.

Helm chartv8.5.1App 8.5.1Verified publisherOfficial

Official Elastic helm chart for Elasticsearch

About this chart

Elasticsearch Helm Chart

This Helm chart is a lightweight way to configure and run our official [Elasticsearch 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 deploy this chart on a specific K8S distribution?
    • How to deploy dedicated nodes types?
      • Coordinating nodes
      • Clustering and Node Discovery
    • How to deploy clusters with security (authentication and TLS) enabled?
    • How to migrate from helm/charts stable chart?
    • How to install plugins?
    • How to use the keystore?
      • Basic example
      • Multiple keys
      • Custom paths and keys
    • How to enable snapshotting?
    • How to configure templates post-deployment?
  • Contributing

Requirements

  • Minimum cluster requirements include the following to run this chart with default settings. All of these settings are configurable.
    • Three Kubernetes nodes to respect the default "hard" affinity settings
    • 1GB of RAM for the JVM heap

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 elasticsearch elastic/elasticsearch

Install a development version using the main branch

  • Clone the git repo: git clone [email protected]:elastic/helm-charts.git

  • Install it: helm install elasticsearch ./helm-charts/elasticsearch --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 esJavaOpts and to set the CPU/Memory resources to something suitable for your cluster.
  • To simplify chart and maintenance each set of node groups is deployed as a separate Helm release. Take a look at the [multi][] example to get an idea for how this works. Without doing this it isn't possible to resize persistent volumes in a StatefulSet. By setting it up this way it makes it possible to add more nodes with a new storage size then drain the old ones. It also solves the problem of allowing the user to determine which node groups to update first when doing upgrades or changes.
  • We have designed this chart to be very un-opinionated about how to configure Elasticsearch. 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.

Configuration

ParameterDescriptionDefault
antiAffinityTopologyKeyThe [anti-affinity][] topology key. By default this will prevent multiple Elasticsearch nodes from running on the same Kubernetes nodekubernetes.io/hostname
antiAffinitySetting this to hard enforces the [anti-affinity][] rules. If it is set to soft it will be done "best effort". Other values will be ignoredhard
clusterHealthCheckParamsThe [Elasticsearch cluster health status params][] that will be used by readiness [probe][] commandwait_for_status=green&timeout=1s
clusterNameThis will be used as the Elasticsearch [cluster.name][] and should be unique per cluster in the namespaceelasticsearch
createCertThis will automatically create the SSL certificatestrue
enableServiceLinksSet to false to disabling service links, which can cause slow pod startup times when there are many services in the current namespace.true
envFromTemplatable string to be passed to the [environment from variables][] which will be appended to the envFrom: definition for the container[]
esConfigAllows you to add any config files in /usr/share/elasticsearch/config/ such as elasticsearch.yml and log4j2.properties. See [values.yaml][] for an example of the formatting{}
esJavaOpts[Java options][] for Elasticsearch. This is where you could configure the [jvm heap size][]""
esJvmOptions[Java options][] for Elasticsearch. Override the default JVM options by adding custom options files . See [values.yaml][] for an example of the formatting{}
esMajorVersionDeprecated. Instead, use the version of the chart corresponding to your ES minor version. Used to set major version specific configuration. If you are using a custom image and not running the default Elasticsearch version you will need to set this to the version you are running (e.g. esMajorVersion: 6)""
extraContainersTemplatable string of additional containers to be passed to the tpl function""
extraEnvsExtra [environment variables][] which will be appended to the env: definition for the container[]
extraInitContainersTemplatable string of additional initContainers to be passed to the tpl function""
extraVolumeMountsTemplatable string of additional volumeMounts to be passed to the tpl function""
extraVolumesTemplatable string of additional volumes to be passed to the tpl function""
fullnameOverrideOverrides the clusterName and nodeGroup when used in the naming of resources. This should only be used when using a single nodeGroup, otherwise you will have name conflicts""
healthNameOverrideOverrides test-elasticsearch-health pod name""
hostAliasesConfigurable [host

Deploy elasticsearch with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has 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 chartelasticsearch is pinned at v8.5.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