elasticsearch
Flexible and powerful open source, distributed real-time search and analytics engine.
About this chart
Elasticsearch Helm Chart
This chart uses a standard Docker image of Elasticsearch (docker.elastic.co/elasticsearch/elasticsearch-oss) and uses a service pointing to the master's transport port for service discovery. Elasticsearch does not communicate with the Kubernetes API, hence no need for RBAC permissions.
Warning for previous users
If you are currently using an earlier version of this Chart you will need to redeploy your Elasticsearch clusters. The discovery method used here is incompatible with using RBAC. If you are upgrading to Elasticsearch 6 from the 5.5 version used in this chart before, please note that your cluster needs to do a full cluster restart. The simplest way to do that is to delete the installation (keep the PVs) and install this chart again with the new version. If you want to avoid doing that upgrade to Elasticsearch 5.6 first before moving on to Elasticsearch 6.0.
Prerequisites Details
- Kubernetes 1.10+
- PV dynamic provisioning support on the underlying infrastructure
StatefulSets Details
- https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/
StatefulSets Caveats
- https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#limitations
Todo
- Implement TLS/Auth/Security
- Smarter upscaling/downscaling
- Solution for memory locking
Chart Details
This chart will do the following:
- Implemented a dynamically scalable elasticsearch cluster using Kubernetes StatefulSets/Deployments
- Multi-role deployment: master, client (coordinating) and data nodes
- Statefulset Supports scaling down without degrading the cluster
Installing the Chart
To install the chart with the release name my-release:
$ helm install --name my-release stable/elasticsearch
Deleting the Charts
Delete the Helm deployment as normal
$ helm delete my-release
Deletion of the StatefulSet doesn't cascade to deleting associated PVCs. To delete them:
$ kubectl delete pvc -l release=my-release,component=data
Configuration
The following table lists the configurable parameters of the elasticsearch chart and their default values.
| Parameter | Description | Default |
|---|---|---|
appVersion | Application Version (Elasticsearch) | 6.8.2 |
image.repository | Container image name | docker.elastic.co/elasticsearch/elasticsearch-oss |
image.tag | Container image tag | 6.8.2 |
image.pullPolicy | Container pull policy | IfNotPresent |
image.pullSecrets | container image pull secrets | [] |
initImage.repository | Init container image name | busybox |
initImage.tag | Init container image tag | latest |
initImage.pullPolicy | Init container pull policy | Always |
schedulerName | Name of the k8s scheduler (other than default) | nil |
cluster.name | Cluster name | elasticsearch |
cluster.xpackEnable | Writes the X-Pack configuration options to the configuration file | false |
cluster.config | Additional cluster config appended | {} |
cluster.keystoreSecret | Name of secret holding secure config options in an es keystore | nil |
cluster.env | Cluster environment variables | {MINIMUM_MASTER_NODES: "2"} |
cluster.bootstrapShellCommand | Post-init command to run in separate Job | "" |
cluster.additionalJavaOpts | Cluster parameters to be added to ES_JAVA_OPTS environment variable | "" |
cluster.plugins | List of Elasticsearch plugins to install | [] |
cluster.loggingYml | Cluster logging configuration for ES v2 | see values.yaml for defaults |
cluster.log4j2Properties | Cluster logging configuration for ES v5 and 6 | see values.yaml for defaults |
client.name | Client component name | client |
client.replicas | Client node replicas (deployment) | 2 |
client.resources | Client node resources requests & limits | {} - cpu limit must be an integer |
client.priorityClassName | Client priorityClass | nil |
client.heapSize | Client node heap size | 512m |
client.podAnnotations | Client Deployment annotations | {} |
client.nodeSelector | Node labels for client pod assignment | {} |
client.tolerations | Client tolerations | [] |
client.terminationGracePeriodSeconds | Client nodes: Termination grace period (seconds) | nil |
client.serviceAnnotations | Client Service annotations | {} |
client.serviceType | Client service type | ClusterIP |
client.httpNodePort | Client service HTTP NodePort port number. Has no effect if client.serviceType is not NodePort. | nil |
client.loadBalancerIP | Client loadBalancerIP | {} |
client.loadBalancerSourceRanges | Client loadBalancerSourceRanges | {} |
client.antiAffinity | Client anti-affinity policy | soft |
client.nodeAffinity | Client node affinity policy | {} |
client.initResources | Client initContainer resources requests & limits | {} |
client.hooks.preStop | Client nodes: Lifecycle hook script to execute prior the pod stops | nil |
client.hooks.preStart | Client nodes: Lifecycle hook script to execute after the pod starts | nil |
client.additionalJavaOpts | Parameters to be added to ES_JAVA_OPTS environment variable for client | "" |
client.ingress.enabled | Enable Client Ingress | false |
client.ingress.user | If this & password are set, enable basic-auth on ingress | nil |
client.ingress.password | If this & user are set, enable basic-auth on ingress | nil |
client.ingress.annotations | Client Ingress annotations | {} |
client.ingress.hosts | Client Ingress Hostnames | [] |
client.ingress.tls | Client Ingress TLS configuration | [] |
master.initResources | Master initContainer resources requests & limits | {} |
master.additionalJavaOpts | Parameters to be added to ES_JAVA_OPTS environment variable for master | "" |
master.exposeHttp | Expose http port 9200 on master Pods for monitoring, etc | false |
master.name | Master component name | master |
master.replicas | Master node replicas (deployment) | 2 |
master.resources | Master node resources requests & limits | {} - cpu limit must be an integer |
master.priorityClassName | Master priorityClass | nil |
master.podAnnotations | Master Deployment annotations | {} |
master.nodeSelector | Node labels for master pod assignment | {} |
master.tolerations | Master tolerations | [] |
master.terminationGracePeriodSeconds | Master nodes: Termination grace period (seconds) | nil |
master.heapSize | Master node heap size | 512m |
master.name | Master component name | master |
master.persistence.enabled | Master persistent enabled/disabled | true |
master.persistence.name | Master statefulset PVC template name | data |
master.persistence.size | Master persistent volume size | 4Gi |
master.persistence.storageClass | Master persistent volume Class | nil |
master.persistence.accessMode | Master persistent Access Mode | ReadWriteOnce |
master.readinessProbe | Master container readiness probes | see values.yaml for defaults |
master.antiAffinity | Master anti-affinity policy | soft |
master.nodeAffinity | Master node affinity policy | {} |
master.podManagementPolicy | Master pod creation strategy | OrderedReady |
master.updateStrategy | Master node update strategy policy | {type: "onDelete"} |
master.hooks.preStop | Master nodes: Lifecycle hook script to execute prior the pod stops | nil |
master.hooks.preStart | Master nodes: Lifecycle hook script to execute after the pod starts | nil |
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 v2.0.0 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