elasticsearch

by joaquinito2051

Helm chartv2.0.0App 7.10.1

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.

ParameterDescriptionDefault
appVersionApplication Version (Elasticsearch)6.8.2
image.repositoryContainer image namedocker.elastic.co/elasticsearch/elasticsearch-oss
image.tagContainer image tag6.8.2
image.pullPolicyContainer pull policyIfNotPresent
image.pullSecretscontainer image pull secrets[]
initImage.repositoryInit container image namebusybox
initImage.tagInit container image taglatest
initImage.pullPolicyInit container pull policyAlways
schedulerNameName of the k8s scheduler (other than default)nil
cluster.nameCluster nameelasticsearch
cluster.xpackEnableWrites the X-Pack configuration options to the configuration filefalse
cluster.configAdditional cluster config appended{}
cluster.keystoreSecretName of secret holding secure config options in an es keystorenil
cluster.envCluster environment variables{MINIMUM_MASTER_NODES: "2"}
cluster.bootstrapShellCommandPost-init command to run in separate Job""
cluster.additionalJavaOptsCluster parameters to be added to ES_JAVA_OPTS environment variable""
cluster.pluginsList of Elasticsearch plugins to install[]
cluster.loggingYmlCluster logging configuration for ES v2see values.yaml for defaults
cluster.log4j2PropertiesCluster logging configuration for ES v5 and 6see values.yaml for defaults
client.nameClient component nameclient
client.replicasClient node replicas (deployment)2
client.resourcesClient node resources requests & limits{} - cpu limit must be an integer
client.priorityClassNameClient priorityClassnil
client.heapSizeClient node heap size512m
client.podAnnotationsClient Deployment annotations{}
client.nodeSelectorNode labels for client pod assignment{}
client.tolerationsClient tolerations[]
client.terminationGracePeriodSecondsClient nodes: Termination grace period (seconds)nil
client.serviceAnnotationsClient Service annotations{}
client.serviceTypeClient service typeClusterIP
client.httpNodePortClient service HTTP NodePort port number. Has no effect if client.serviceType is not NodePort.nil
client.loadBalancerIPClient loadBalancerIP{}
client.loadBalancerSourceRangesClient loadBalancerSourceRanges{}
client.antiAffinityClient anti-affinity policysoft
client.nodeAffinityClient node affinity policy{}
client.initResourcesClient initContainer resources requests & limits{}
client.hooks.preStopClient nodes: Lifecycle hook script to execute prior the pod stopsnil
client.hooks.preStartClient nodes: Lifecycle hook script to execute after the pod startsnil
client.additionalJavaOptsParameters to be added to ES_JAVA_OPTS environment variable for client""
client.ingress.enabledEnable Client Ingressfalse
client.ingress.userIf this & password are set, enable basic-auth on ingressnil
client.ingress.passwordIf this & user are set, enable basic-auth on ingressnil
client.ingress.annotationsClient Ingress annotations{}
client.ingress.hostsClient Ingress Hostnames[]
client.ingress.tlsClient Ingress TLS configuration[]
master.initResourcesMaster initContainer resources requests & limits{}
master.additionalJavaOptsParameters to be added to ES_JAVA_OPTS environment variable for master""
master.exposeHttpExpose http port 9200 on master Pods for monitoring, etcfalse
master.nameMaster component namemaster
master.replicasMaster node replicas (deployment)2
master.resourcesMaster node resources requests & limits{} - cpu limit must be an integer
master.priorityClassNameMaster priorityClassnil
master.podAnnotationsMaster Deployment annotations{}
master.nodeSelectorNode labels for master pod assignment{}
master.tolerationsMaster tolerations[]
master.terminationGracePeriodSecondsMaster nodes: Termination grace period (seconds)nil
master.heapSizeMaster node heap size512m
master.nameMaster component namemaster
master.persistence.enabledMaster persistent enabled/disabledtrue
master.persistence.nameMaster statefulset PVC template namedata
master.persistence.sizeMaster persistent volume size4Gi
master.persistence.storageClassMaster persistent volume Classnil
master.persistence.accessModeMaster persistent Access ModeReadWriteOnce
master.readinessProbeMaster container readiness probessee values.yaml for defaults
master.antiAffinityMaster anti-affinity policysoft
master.nodeAffinityMaster node affinity policy{}
master.podManagementPolicyMaster pod creation strategyOrderedReady
master.updateStrategyMaster node update strategy policy{type: "onDelete"}
master.hooks.preStopMaster nodes: Lifecycle hook script to execute prior the pod stopsnil
master.hooks.preStartMaster nodes: Lifecycle hook script to execute after the pod startsnil

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 v2.0.0 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