elasticsearch
by kfirfer
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][].
- 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 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.17.3 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
- with Helm 3:
Install development version from a branch
-
Clone the git repo:
git clone [email protected]:elastic/helm-charts.git -
Checkout the branch :
git checkout 7.17 -
Install it:
- with Helm 3:
helm install elasticsearch ./helm-charts/elasticsearch --set imageTag=7.17.3 - with Helm 2 (deprecated):
helm install --name elasticsearch ./helm-charts/elasticsearch --set imageTag=7.17.3
- with Helm 3:
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
esJavaOptsand to set the CPU/Memoryresourcesto 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
| Parameter | Description | Default |
|---|---|---|
antiAffinityTopologyKey | The [anti-affinity][] topology key. By default this will prevent multiple Elasticsearch 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 |
clusterHealthCheckParams | The [Elasticsearch cluster health status params][] that will be used by readiness [probe][] command | wait_for_status=green&timeout=1s |
clusterName | This will be used as the Elasticsearch [cluster.name][] and should be unique per cluster in the namespace | elasticsearch |
clusterDeprecationIndexing | Enable or disable deprecation logs to be indexed (should be disabled when deploying master only node groups) | false |
enableServiceLinks | Set to false to disabling service links, which can cause slow pod startup times when there are many services in the current namespace. | true |
envFrom | Templatable string to be passed to the [environment from variables][] which will be appended to the envFrom: definition for the container | [] |
esConfig | Allows 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 | {} |
esMajorVersion | Deprecated. 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) | "" |
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 | "" |
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 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 | "" |
healthNameOverride | Overrides test-elasticsearch-health pod name | "" |
hostAliases | Configurable [hostAliases][] | [] |
httpPort | The 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 extraEnvs | 9200 |
imagePullPolicy | The Kubernetes [imagePullPolicy][] value |
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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartelasticsearch is pinned at v8.6.4 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