elasticsearch

by braedon

Helm chartv7.10.3-BV1App 7.10.3-BV1Verified publisher

Official Elastic helm chart for Elasticsearch

About this chart

Elasticsearch Helm Chart

Copied from https://github.com/elastic/helm-charts/tree/7.10

This Helm chart is a lightweight way to configure and run our official [Elasticsearch Docker image][].

Warning: This branch is used for development, please use the latest [7.x][] release for released version.

  • Requirements
  • Installing
    • Install released version using Helm repository
    • Install development version from a branch
  • Upgrading
  • Usage notes
  • Configuration
    • Deprecated
  • FAQ
    • How to deploy this chart on a specific K8S distribution?
    • How to deploy dedicated nodes types?
      • 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 OSS version of Elasticsearch?
    • 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

  • Kubernetes >= 1.14
  • [Helm][] >= 2.17.0
  • 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

This chart is tested with the latest 7.10.3-SNAPSHOT version.

Install released version using Helm repository

  • Add the Elastic Helm charts repo: helm repo add elastic https://helm.elastic.co

  • Install it:

    • with Helm 3: helm install elasticsearch --version <version> elastic/elasticsearch
    • with Helm 2 (deprecated): helm install --name elasticsearch --version <version> elastic/elasticsearch

Install development version from a branch

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

  • Checkout the branch : git checkout 7.10

  • Install it:

    • with Helm 3: helm install elasticsearch ./helm-charts/elasticsearch --set imageTag=7.10.3-SNAPSHOT
    • with Helm 2 (deprecated): helm install --name elasticsearch ./helm-charts/elasticsearch --set imageTag=7.10.3-SNAPSHOT

Upgrading

Please always check [CHANGELOG.md][] and [BREAKING_CHANGES.md][] before upgrading to a new chart version.

Usage notes

  • This repo includes a number of [examples][] configurations which 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
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 should configure the [jvm heap size][]-Xmx1g -Xms1g
esMajorVersionUsed 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""
hostAliasesConfigurable [hostAliases][][]
httpPortThe http port that Kubernetes will use for the healthchecks and the service. If you change this you will also need to set [http.port][] in extraEnvs9200
imagePullPolicyThe Kubernetes [imagePullPolicy][] valueIfNotPresent
imagePullSecretsConfiguration for [imagePullSecrets][] so that you can use a private registry for your image[]
imageTagThe Elasticsearch Docker image tag7.10.3-SNAPSHOT
imageThe Elasticsearch Docker imagedocker.elastic.co/elasticsearch/elasticsearch
ingressConfigurable [ingress][] to expose the Elasticsearch service. See [values.yaml][] for an examplesee [values.yaml][]
initResourcesAllows you to set the [resources][] for the initContainer in the StatefulSet{}
keystoreAllows you map Kubernetes secrets into the keystore. See the [config example][] and [how to use the keystore][][]
labelsConfigurable [labels][] applied to all Elasticsearch pods

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 v7.10.3-BV1 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