From 0ad27d0cb949e1e1cab92109331b1fe06ce882d2 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 30 Aug 2017 13:08:50 +0530 Subject: [PATCH 01/19] elasticsearch: support multinode cluster deployments --- incubator/elasticsearch/README.md | 4 -- incubator/elasticsearch/templates/cm.yaml | 18 +++++ incubator/elasticsearch/templates/pvc.yaml | 30 --------- .../{deployment.yaml => statefulset.yaml} | 67 +++++++++++++------ incubator/elasticsearch/templates/svc.yaml | 4 +- incubator/elasticsearch/values.yaml | 26 ++----- 6 files changed, 73 insertions(+), 76 deletions(-) create mode 100644 incubator/elasticsearch/templates/cm.yaml delete mode 100644 incubator/elasticsearch/templates/pvc.yaml rename incubator/elasticsearch/templates/{deployment.yaml => statefulset.yaml} (50%) diff --git a/incubator/elasticsearch/README.md b/incubator/elasticsearch/README.md index 7fa335065..bbae53251 100644 --- a/incubator/elasticsearch/README.md +++ b/incubator/elasticsearch/README.md @@ -48,15 +48,11 @@ The following tables lists the configurable parameters of the Elasticsearch char | `image` | Elasticsearch image | `bitnami/elasticsearch:{VERSION}` | | `imagePullPolicy` | Image pull policy | `IfNotPresent` | | `elasticsearchClusterName` | Elasticsearch cluster name | `elasticsearch-cluster` | -| `elasticsearchNodeName` | Elasticsearch node name | `` | | `elasticsearchPortNumber` | Elasticsearch port | `9200` | | `elasticsearchNodePortNumber` | Elasticsearch Node to Node port | `9300` | -| `elasticsearchClusterHosts` | Elasticsearch hosts list (comma/colon seperated) | `` | -| `elasticsClientNode` | Elasticsearch node to behave as a 'smart router' for Kibana app | `false` | | `serviceType` | Kubernetes Service type | `ClusterIP` | | `persistence.enabled` | Enable persistence using a `PersistentVolumeClaim` | `true` | | `persistence.annotations` | Persistent Volume Claim annotations | `{}` | -| `persistence.existingClaim` | Persistent Volume existing claim name | `` | | `persistence.storageClass` | Persistent Volume Storage Class | `` | | `persistence.accessModes` | Persistent Volume Access Modes | `[ReadWriteOnce]` | | `persistence.size` | Persistent Volume Size | `8Gi` | diff --git a/incubator/elasticsearch/templates/cm.yaml b/incubator/elasticsearch/templates/cm.yaml new file mode 100644 index 000000000..8a947f1db --- /dev/null +++ b/incubator/elasticsearch/templates/cm.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "fullname" . }} + labels: + app: {{ template "name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +data: + elasticsearch_custom.yml: |- + + cloud: + kubernetes: + service: ${SERVICE} + namespace: ${KUBERNETES_NAMESPACE} + discovery.zen.hosts_provider: kubernetes + plugin.mandatory: discovery-kubernetes diff --git a/incubator/elasticsearch/templates/pvc.yaml b/incubator/elasticsearch/templates/pvc.yaml deleted file mode 100644 index 855fc2b67..000000000 --- a/incubator/elasticsearch/templates/pvc.yaml +++ /dev/null @@ -1,30 +0,0 @@ -{{- if .Values.persistence.enabled -}} -{{- if not .Values.persistence.existingClaim -}} -kind: PersistentVolumeClaim -apiVersion: v1 -metadata: - name: "{{ template "fullname" . }}" - labels: - app: "{{ template "name" . }}" - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - release: "{{ .Release.Name }}" - heritage: "{{ .Release.Service }}" - {{- if .Values.persistence.annotations }} - annotations: -{{ toYaml .Values.persistence.annotations | indent 4 }} - {{- end }} -spec: - accessModes: -{{ toYaml .Values.persistence.accessModes | indent 4 }} -{{- if .Values.persistence.storageClass }} -{{- if (eq "-" .Values.persistence.storageClass) }} - storageClassName: "" -{{- else }} - storageClassName: "{{ .Values.persistence.storageClass }}" -{{- end }} -{{- end }} - resources: - requests: - storage: "{{ .Values.persistence.size }}" -{{- end -}} -{{- end -}} diff --git a/incubator/elasticsearch/templates/deployment.yaml b/incubator/elasticsearch/templates/statefulset.yaml similarity index 50% rename from incubator/elasticsearch/templates/deployment.yaml rename to incubator/elasticsearch/templates/statefulset.yaml index 9e5f7eb9a..963573386 100644 --- a/incubator/elasticsearch/templates/deployment.yaml +++ b/incubator/elasticsearch/templates/statefulset.yaml @@ -1,5 +1,5 @@ -apiVersion: extensions/v1beta1 -kind: Deployment +apiVersion: apps/v1beta1 +kind: StatefulSet metadata: name: "{{ template "fullname" . }}" labels: @@ -8,21 +8,20 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: + serviceName: "{{ template "fullname" . }}" + replicas: {{ .Values.replicas }} template: metadata: labels: app: "{{ template "name" . }}" release: "{{ .Release.Name }}" spec: + serviceAccountName: "{{ .Values.serviceAccountName }}" initContainers: - name: sysctl image: "{{ .Values.image }}" imagePullPolicy: "{{ .Values.imagePullPolicy }}" - command: - - bash - - -c - - | - sysctl -w vm.max_map_count=262144 + command: ["sysctl", "-w", "vm.max_map_count=262144"] securityContext: privileged: true containers: @@ -30,43 +29,69 @@ spec: image: "{{ .Values.image }}" imagePullPolicy: "{{ .Values.imagePullPolicy }}" env: + - name: SERVICE + value: "{{ template "fullname" . }}" + - name: KUBERNETES_NAMESPACE + value: "{{ .Release.Namespace }}" - name: ELASTICSEARCH_CLUSTER_NAME value: "{{ .Values.elasticsearchClusterName }}" - - name: ELASTICSEARCH_NODE_NAME - value: "{{ .Values.elasticsearchNodeName }}" - name: ELASTICSEARCH_PORT_NUMBER value: "{{ .Values.elasticsearchPortNumber }}" - name: ELASTICSEARCH_NODE_PORT_NUMBER value: "{{ .Values.elasticsearchNodePortNumber }}" - - name: ELASTICSEARCH_CLUSTER_HOSTS - value: "{{ .Values.elasticsearchClusterHosts }}" - - name: ELASTICSEARCH_CLIENT_NODE - value: "{{ .Values.elasticsearchClientNode }}" + - name: ELASTICSEARCH_PLUGINS + value: "io.fabric8:elasticsearch-cloud-kubernetes:5.5.1" + - name: ES_JAVA_OPTS + value: "-Djava.net.preferIPv4Stack=true -Xms{{ .Values.elasticsearchHeapSize }} -Xmx{{ .Values.elasticsearchHeapSize }}" ports: - - name: "rest" + - name: "http" containerPort: {{ .Values.elasticsearchPortNumber }} - name: transport containerPort: {{ .Values.elasticsearchNodePortNumber }} livenessProbe: httpGet: path: /_cluster/health?local=true - port: "rest" + port: "http" initialDelaySeconds: 30 readinessProbe: httpGet: path: /_cluster/health?local=true - port: "rest" + port: "http" initialDelaySeconds: 5 resources: {{ toYaml .Values.resources | indent 10 }} volumeMounts: + - mountPath: /bitnami/elasticsearch/conf/elasticsearch_custom.yml + name: "config" + subPath: elasticsearch_custom.yml - name: "data" mountPath: "/bitnami" volumes: + - name: "config" + configMap: + name: "{{ template "fullname" . }}" +{{- if .Values.persistence.enabled }} + volumeClaimTemplates: + - metadata: + name: "data" +{{- if .Values.persistence.annotations }} + annotations: +{{ toYaml .Values.persistence.annotations | indent 6 }} +{{- end }} + spec: + accessModes: +{{ toYaml .Values.persistence.accessModes | indent 6 }} +{{- if .Values.persistence.storageClass }} +{{- if (eq "-" .Values.persistence.storageClass) }} + storageClassName: "" +{{- else }} + storageClassName: "{{ .Values.persistence.storageClass }}" +{{- end }} +{{- end }} + resources: + requests: + storage: "{{ .Values.persistence.size }}" +{{- else }} - name: "data" - {{- if .Values.persistence.enabled }} - persistentVolumeClaim: - claimName: "{{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "fullname" . }}{{- end }}" - {{- else }} emptyDir: {} - {{- end -}} +{{- end }} diff --git a/incubator/elasticsearch/templates/svc.yaml b/incubator/elasticsearch/templates/svc.yaml index 85709e2bf..b6557cc23 100644 --- a/incubator/elasticsearch/templates/svc.yaml +++ b/incubator/elasticsearch/templates/svc.yaml @@ -10,9 +10,9 @@ metadata: spec: type: "{{ .Values.serviceType }}" ports: - - name: "rest" + - name: "http" port: {{ .Values.elasticsearchPortNumber }} - targetPort: "rest" + targetPort: "http" - name: "transport" port: {{ .Values.elasticsearchNodePortNumber }} targetPort: "transport" diff --git a/incubator/elasticsearch/values.yaml b/incubator/elasticsearch/values.yaml index 37666e58b..7541a07bf 100644 --- a/incubator/elasticsearch/values.yaml +++ b/incubator/elasticsearch/values.yaml @@ -1,23 +1,24 @@ ## Bitnami Elasticsearch image version ## ref: https://hub.docker.com/r/bitnami/elasticsearch/tags/ ## -image: bitnami/elasticsearch:5.5.1-r0 +image: bitnami/elasticsearch:5.5.1-r1 ## Specify a imagePullPolicy ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images ## imagePullPolicy: IfNotPresent +replicas: 3 + +serviceAccountName: default + +elasticsearchHeapSize: 256m + ## Elasticsearch cluster name ## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables ## elasticsearchClusterName: elasticsearch-cluster -## Elasticsearch node name -## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables -## -# elasticsearchNodeName: - ## Elasticsearch port ## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables ## @@ -28,16 +29,6 @@ elasticsearchPortNumber: 9200 ## elasticsearchNodePortNumber: 9300 -## Elasticsearch hosts list (comma/colon seperated) -## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables -## -# elasticsearchClusterHosts: - -## Elasticsearch node to behave as a 'smart router' for Kibana app -## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables -## -elasticsearchClientNode: false - ## Kubernetes configuration ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## @@ -55,9 +46,6 @@ persistence: ## annotations: {} - ## Persistent Volume existing claim name - # existingClaim: - ## Persistent Volume Storage Class ## If defined, storageClassName: ## If set to "-", storageClassName: "", which disables dynamic provisioning From 7428d5f5576bd3479a5bb5a6380f98e6bafc2b05 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 30 Aug 2017 15:45:36 +0530 Subject: [PATCH 02/19] allow customization of elasticsearch configuratoin --- incubator/elasticsearch/templates/cm.yaml | 16 ++++++++++------ incubator/elasticsearch/values.yaml | 2 ++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/incubator/elasticsearch/templates/cm.yaml b/incubator/elasticsearch/templates/cm.yaml index 8a947f1db..f6986a0f9 100644 --- a/incubator/elasticsearch/templates/cm.yaml +++ b/incubator/elasticsearch/templates/cm.yaml @@ -10,9 +10,13 @@ metadata: data: elasticsearch_custom.yml: |- - cloud: - kubernetes: - service: ${SERVICE} - namespace: ${KUBERNETES_NAMESPACE} - discovery.zen.hosts_provider: kubernetes - plugin.mandatory: discovery-kubernetes + cloud: + kubernetes: + service: ${SERVICE} + namespace: ${KUBERNETES_NAMESPACE} + discovery.zen.hosts_provider: kubernetes + plugin.mandatory: discovery-kubernetes + +{{- if .Values.elasticsearchConfig }} +{{ toYaml .Values.elasticsearchConfig | indent 4 }} +{{- end }} diff --git a/incubator/elasticsearch/values.yaml b/incubator/elasticsearch/values.yaml index 7541a07bf..13c777294 100644 --- a/incubator/elasticsearch/values.yaml +++ b/incubator/elasticsearch/values.yaml @@ -63,6 +63,8 @@ persistence: ## size: 8Gi +elasticsearchConfig: + ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ ## From 87fbbe5a85f938a748d053b2abe37a906ddc5c48 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 30 Aug 2017 17:52:53 +0530 Subject: [PATCH 03/19] add `elasticsearchPlugins` param --- incubator/elasticsearch/templates/statefulset.yaml | 2 +- incubator/elasticsearch/values.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/incubator/elasticsearch/templates/statefulset.yaml b/incubator/elasticsearch/templates/statefulset.yaml index 963573386..f8a6baacf 100644 --- a/incubator/elasticsearch/templates/statefulset.yaml +++ b/incubator/elasticsearch/templates/statefulset.yaml @@ -40,7 +40,7 @@ spec: - name: ELASTICSEARCH_NODE_PORT_NUMBER value: "{{ .Values.elasticsearchNodePortNumber }}" - name: ELASTICSEARCH_PLUGINS - value: "io.fabric8:elasticsearch-cloud-kubernetes:5.5.1" + value: "{{ .Values.elasticsearchPlugins }}" - name: ES_JAVA_OPTS value: "-Djava.net.preferIPv4Stack=true -Xms{{ .Values.elasticsearchHeapSize }} -Xmx{{ .Values.elasticsearchHeapSize }}" ports: diff --git a/incubator/elasticsearch/values.yaml b/incubator/elasticsearch/values.yaml index 13c777294..76447568f 100644 --- a/incubator/elasticsearch/values.yaml +++ b/incubator/elasticsearch/values.yaml @@ -29,6 +29,8 @@ elasticsearchPortNumber: 9200 ## elasticsearchNodePortNumber: 9300 +elasticsearchPlugins: io.fabric8:elasticsearch-cloud-kubernetes:5.5.1 + ## Kubernetes configuration ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## From 71ff1f0a23a608d555c698afce7a44e5f560484b Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 30 Aug 2017 22:01:21 +0530 Subject: [PATCH 04/19] add master and data node seperation --- incubator/elasticsearch/Chart.yaml | 4 +- incubator/elasticsearch/README.md | 39 +++-- incubator/elasticsearch/templates/NOTES.txt | 21 ++- incubator/elasticsearch/templates/cm.yaml | 7 +- ...statefulset.yaml => data-statefulset.yaml} | 54 +++---- .../templates/master-deploy.yaml | 79 ++++++++++ incubator/elasticsearch/templates/svc.yaml | 7 +- incubator/elasticsearch/values.yaml | 136 +++++++++--------- 8 files changed, 226 insertions(+), 121 deletions(-) rename incubator/elasticsearch/templates/{statefulset.yaml => data-statefulset.yaml} (56%) create mode 100644 incubator/elasticsearch/templates/master-deploy.yaml diff --git a/incubator/elasticsearch/Chart.yaml b/incubator/elasticsearch/Chart.yaml index b48e24856..e5cd4cbb5 100644 --- a/incubator/elasticsearch/Chart.yaml +++ b/incubator/elasticsearch/Chart.yaml @@ -1,6 +1,6 @@ name: elasticsearch -version: 0.0.1 -appVersion: 5.5.1 +version: 0.1.0 +appVersion: 5.5.2 description: A highly scalable open-source full-text search and analytics engine keywords: - elasticsearch diff --git a/incubator/elasticsearch/README.md b/incubator/elasticsearch/README.md index bbae53251..651f8e41e 100644 --- a/incubator/elasticsearch/README.md +++ b/incubator/elasticsearch/README.md @@ -2,7 +2,7 @@ [Elasticsearch](https://www.elastic.co/products/elasticsearch) is a highly scalable open-source full-text search and analytics engine. It allows you to store, search, and analyze big volumes of data quickly and in near real time. -## TL;DR; +## TL;DR ```console $ helm install incubator/elasticsearch @@ -43,20 +43,29 @@ The command removes all the Kubernetes components associated with the chart and The following tables lists the configurable parameters of the Elasticsearch chart and their default values. -| Parameter | Description | Default | -|-------------------------------|-----------------------------------------------------------------|-----------------------------------| -| `image` | Elasticsearch image | `bitnami/elasticsearch:{VERSION}` | -| `imagePullPolicy` | Image pull policy | `IfNotPresent` | -| `elasticsearchClusterName` | Elasticsearch cluster name | `elasticsearch-cluster` | -| `elasticsearchPortNumber` | Elasticsearch port | `9200` | -| `elasticsearchNodePortNumber` | Elasticsearch Node to Node port | `9300` | -| `serviceType` | Kubernetes Service type | `ClusterIP` | -| `persistence.enabled` | Enable persistence using a `PersistentVolumeClaim` | `true` | -| `persistence.annotations` | Persistent Volume Claim annotations | `{}` | -| `persistence.storageClass` | Persistent Volume Storage Class | `` | -| `persistence.accessModes` | Persistent Volume Access Modes | `[ReadWriteOnce]` | -| `persistence.size` | Persistent Volume Size | `8Gi` | -| `resources` | CPU/Memory resource requests/limits | `` | +| Parameter | Description | Default | +|--------------------------------------|----------------------------------------------------|--------------------------------------------------------| +| `image.name` | Elasticsearch image name | `bitnami/elasticsearch` | +| `image.tag` | Elasticsearch image tag | `{VERSION}` | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `service.type` | Kubernetes Service type | `ClusterIP` | +| `service.port.http` | Elasticsearch HTTP port | `9200` | +| `service.port.transport` | Elasticsearch transport port | `9300` | +| `cluster.name` | Elasticsearch cluster name | `elasticsearch-cluster` | +| `cluster.serviceAccountName` | Kubernetes service account | `default` | +| `cluster.plugins` | Elasticsearch plugins | `io.fabric8:elasticsearch-cloud-kubernetes` (required) | +| `cluster.config` | Elasticsearch custom configuration | `` | +| `node.master.replicas` | | `1` | +| `node.master.heapSize` | | `256m` | +| `node.master.resources` | CPU/Memory resource requests/limits | `` | +| `node.data.replicas` | | `3` | +| `node.data.heapSize` | | `256m` | +| `node.data.resources` | CPU/Memory resource requests/limits | `` | +| `node.data.persistence.enabled` | Enable persistence using a `PersistentVolumeClaim` | `true` | +| `node.data.persistence.annotations` | Persistent Volume Claim annotations | `{}` | +| `node.data.persistence.storageClass` | Persistent Volume Storage Class | `` | +| `node.data.persistence.accessModes` | Persistent Volume Access Modes | `[ReadWriteOnce]` | +| `node.data.persistence.size` | Persistent Volume Size | `8Gi` | The above parameters map to the env variables defined in [bitnami/elasticsearch](http://github.com/bitnami/bitnami-docker-elasticsearch). For more information please refer to the [bitnami/elasticsearch](http://github.com/bitnami/bitnami-docker-elasticsearch) image documentation. diff --git a/incubator/elasticsearch/templates/NOTES.txt b/incubator/elasticsearch/templates/NOTES.txt index cfeccb35c..3ebdef4d2 100644 --- a/incubator/elasticsearch/templates/NOTES.txt +++ b/incubator/elasticsearch/templates/NOTES.txt @@ -1,38 +1,37 @@ -{{- if contains .Values.serviceType "LoadBalancer" }} +{{- if contains .Values.service.type "LoadBalancer" }} ------------------------------------------------------------------------------- WARNING - By specifying "serviceType=LoadBalancer" you have most likely exposed the + By specifying "service.type=LoadBalancer" you have most likely exposed the Elasticsearch service externally. Please note that Elasticsearch does not implement a authentication mechanism to secure your cluster. - For security reasons, we strongly suggest that you switch to using "ClusterIP" - or "NodePort" as the "serviceType". + For security reasons, we strongly suggest that you switch to using "ClusterIP" or "NodePort". ------------------------------------------------------------------------------- {{- end }} ** Please be patient while the chart is being deployed ** - Elasticsearch can be accessed within the cluster on port {{ .Values.elasticsearchPortNumber }} at {{ template "fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local + Elasticsearch can be accessed within the cluster on port {{ .Values.service.port.http }} at {{ template "fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local To access from outside the cluster execute the following commands: -{{- if contains "NodePort" .Values.serviceType }} +{{- if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT/ -{{- else if contains "LoadBalancer" .Values.serviceType }} +{{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - echo http://$SERVICE_IP:{{ .Values.elasticsearchPortNumber }}/ -{{- else if contains "ClusterIP" .Values.serviceType }} + echo http://$SERVICE_IP:{{ .Values.service.port.http }}/ +{{- else if contains "ClusterIP" .Values.service.type }} export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") - echo http://127.0.0.1:{{ .Values.elasticsearchPortNumber }}/ - kubectl port-forward $POD_NAME {{ .Values.elasticsearchPortNumber }}:{{ .Values.elasticsearchPortNumber }} + echo http://127.0.0.1:{{ .Values.service.port.http }}/ + kubectl port-forward $POD_NAME {{ .Values.service.port.http }}:{{ .Values.service.port.http }} {{- end }} diff --git a/incubator/elasticsearch/templates/cm.yaml b/incubator/elasticsearch/templates/cm.yaml index f6986a0f9..7fc85da18 100644 --- a/incubator/elasticsearch/templates/cm.yaml +++ b/incubator/elasticsearch/templates/cm.yaml @@ -10,6 +10,9 @@ metadata: data: elasticsearch_custom.yml: |- + node.master: ${NODE_MASTER} + node.data: ${NODE_DATA} + cloud: kubernetes: service: ${SERVICE} @@ -17,6 +20,6 @@ data: discovery.zen.hosts_provider: kubernetes plugin.mandatory: discovery-kubernetes -{{- if .Values.elasticsearchConfig }} -{{ toYaml .Values.elasticsearchConfig | indent 4 }} +{{- if .Values.cluster.config }} +{{ toYaml .Values.cluster.config | indent 4 }} {{- end }} diff --git a/incubator/elasticsearch/templates/statefulset.yaml b/incubator/elasticsearch/templates/data-statefulset.yaml similarity index 56% rename from incubator/elasticsearch/templates/statefulset.yaml rename to incubator/elasticsearch/templates/data-statefulset.yaml index f8a6baacf..42133b8da 100644 --- a/incubator/elasticsearch/templates/statefulset.yaml +++ b/incubator/elasticsearch/templates/data-statefulset.yaml @@ -1,53 +1,59 @@ apiVersion: apps/v1beta1 kind: StatefulSet metadata: - name: "{{ template "fullname" . }}" + name: "{{ template "fullname" . }}-data" labels: app: "{{ template "name" . }}" chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + component: "data" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - serviceName: "{{ template "fullname" . }}" - replicas: {{ .Values.replicas }} + serviceName: "{{ template "fullname" . }}-data" + replicas: {{ .Values.node.data.replicas }} template: metadata: labels: app: "{{ template "name" . }}" + component: "data" release: "{{ .Release.Name }}" spec: - serviceAccountName: "{{ .Values.serviceAccountName }}" + serviceAccountName: "{{ .Values.cluster.serviceAccountName }}" initContainers: - name: sysctl - image: "{{ .Values.image }}" - imagePullPolicy: "{{ .Values.imagePullPolicy }}" + image: "{{ .Values.image.name }}:{{ .Values.image.tag }}" + imagePullPolicy: "{{ .Values.image.pullPolicy }}" command: ["sysctl", "-w", "vm.max_map_count=262144"] securityContext: privileged: true containers: - name: "{{ template "fullname" . }}" - image: "{{ .Values.image }}" - imagePullPolicy: "{{ .Values.imagePullPolicy }}" + image: "{{ .Values.image.name }}:{{ .Values.image.tag }}" + imagePullPolicy: "{{ .Values.image.pullPolicy }}" env: - name: SERVICE value: "{{ template "fullname" . }}" - name: KUBERNETES_NAMESPACE value: "{{ .Release.Namespace }}" + - name: NODE_MASTER + value: "false" + - name: NODE_DATA + value: "true" - name: ELASTICSEARCH_CLUSTER_NAME - value: "{{ .Values.elasticsearchClusterName }}" + value: "{{ .Values.cluster.name }}" - name: ELASTICSEARCH_PORT_NUMBER - value: "{{ .Values.elasticsearchPortNumber }}" + value: "{{ .Values.service.port.http }}" - name: ELASTICSEARCH_NODE_PORT_NUMBER - value: "{{ .Values.elasticsearchNodePortNumber }}" + value: "{{ .Values.service.port.transport }}" - name: ELASTICSEARCH_PLUGINS - value: "{{ .Values.elasticsearchPlugins }}" + value: "{{ .Values.cluster.plugins }}" - name: ES_JAVA_OPTS - value: "-Djava.net.preferIPv4Stack=true -Xms{{ .Values.elasticsearchHeapSize }} -Xmx{{ .Values.elasticsearchHeapSize }}" + value: "-Djava.net.preferIPv4Stack=true -Xms{{ .Values.node.data.heapSize }} -Xmx{{ .Values.node.data.heapSize }}" ports: - name: "http" - containerPort: {{ .Values.elasticsearchPortNumber }} + containerPort: {{ .Values.service.port.http }} - name: transport - containerPort: {{ .Values.elasticsearchNodePortNumber }} + containerPort: {{ .Values.service.port.transport }} livenessProbe: httpGet: path: /_cluster/health?local=true @@ -59,7 +65,7 @@ spec: port: "http" initialDelaySeconds: 5 resources: -{{ toYaml .Values.resources | indent 10 }} +{{ toYaml .Values.node.data.resources | indent 10 }} volumeMounts: - mountPath: /bitnami/elasticsearch/conf/elasticsearch_custom.yml name: "config" @@ -70,27 +76,27 @@ spec: - name: "config" configMap: name: "{{ template "fullname" . }}" -{{- if .Values.persistence.enabled }} +{{- if .Values.node.data.persistence.enabled }} volumeClaimTemplates: - metadata: name: "data" -{{- if .Values.persistence.annotations }} +{{- if .Values.node.data.persistence.annotations }} annotations: -{{ toYaml .Values.persistence.annotations | indent 6 }} +{{ toYaml .Values.node.data.persistence.annotations | indent 6 }} {{- end }} spec: accessModes: -{{ toYaml .Values.persistence.accessModes | indent 6 }} -{{- if .Values.persistence.storageClass }} -{{- if (eq "-" .Values.persistence.storageClass) }} +{{ toYaml .Values.node.data.persistence.accessModes | indent 6 }} +{{- if .Values.node.data.persistence.storageClass }} +{{- if (eq "-" .Values.node.data.persistence.storageClass) }} storageClassName: "" {{- else }} - storageClassName: "{{ .Values.persistence.storageClass }}" + storageClassName: "{{ .Values.node.data.persistence.storageClass }}" {{- end }} {{- end }} resources: requests: - storage: "{{ .Values.persistence.size }}" + storage: "{{ .Values.node.data.persistence.size }}" {{- else }} - name: "data" emptyDir: {} diff --git a/incubator/elasticsearch/templates/master-deploy.yaml b/incubator/elasticsearch/templates/master-deploy.yaml new file mode 100644 index 000000000..f808f6e6f --- /dev/null +++ b/incubator/elasticsearch/templates/master-deploy.yaml @@ -0,0 +1,79 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: "{{ template "fullname" . }}-master" + labels: + app: "{{ template "name" . }}" + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + component: "master" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + replicas: {{ .Values.node.master.replicas }} + template: + metadata: + labels: + app: "{{ template "name" . }}" + component: "master" + release: "{{ .Release.Name }}" + spec: + serviceAccountName: "{{ .Values.cluster.serviceAccountName }}" + initContainers: + - name: sysctl + image: "{{ .Values.image.name }}:{{ .Values.image.tag }}" + imagePullPolicy: "{{ .Values.image.pullPolicy }}" + command: ["sysctl", "-w", "vm.max_map_count=262144"] + securityContext: + privileged: true + containers: + - name: "{{ template "fullname" . }}" + image: "{{ .Values.image.name }}:{{ .Values.image.tag }}" + imagePullPolicy: "{{ .Values.image.pullPolicy }}" + env: + - name: SERVICE + value: "{{ template "fullname" . }}" + - name: KUBERNETES_NAMESPACE + value: "{{ .Release.Namespace }}" + - name: NODE_MASTER + value: "true" + - name: NODE_DATA + value: "false" + - name: ELASTICSEARCH_CLUSTER_NAME + value: "{{ .Values.cluster.name }}" + - name: ELASTICSEARCH_PORT_NUMBER + value: "{{ .Values.service.port.http }}" + - name: ELASTICSEARCH_NODE_PORT_NUMBER + value: "{{ .Values.service.port.transport }}" + - name: ELASTICSEARCH_PLUGINS + value: "{{ .Values.cluster.plugins }}" + - name: ES_JAVA_OPTS + value: "-Djava.net.preferIPv4Stack=true -Xms{{ .Values.node.master.heapSize }} -Xmx{{ .Values.node.master.heapSize }}" + ports: + - name: "http" + containerPort: {{ .Values.service.port.http }} + - name: transport + containerPort: {{ .Values.service.port.transport }} + livenessProbe: + httpGet: + path: /_cluster/health?local=true + port: "http" + initialDelaySeconds: 30 + readinessProbe: + httpGet: + path: /_cluster/health?local=true + port: "http" + initialDelaySeconds: 5 + resources: +{{ toYaml .Values.node.master.resources | indent 10 }} + volumeMounts: + - mountPath: /bitnami/elasticsearch/conf/elasticsearch_custom.yml + name: "config" + subPath: elasticsearch_custom.yml + - name: "data" + mountPath: "/bitnami" + volumes: + - name: "config" + configMap: + name: "{{ template "fullname" . }}" + - name: "data" + emptyDir: {} diff --git a/incubator/elasticsearch/templates/svc.yaml b/incubator/elasticsearch/templates/svc.yaml index b6557cc23..f1b87ea96 100644 --- a/incubator/elasticsearch/templates/svc.yaml +++ b/incubator/elasticsearch/templates/svc.yaml @@ -8,14 +8,15 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - type: "{{ .Values.serviceType }}" + type: "{{ .Values.service.type }}" ports: - name: "http" - port: {{ .Values.elasticsearchPortNumber }} + port: {{ .Values.service.port.http }} targetPort: "http" - name: "transport" - port: {{ .Values.elasticsearchNodePortNumber }} + port: {{ .Values.service.port.transport }} targetPort: "transport" selector: app: "{{ template "name" . }}" release: "{{ .Release.Name }}" + component: "master" diff --git a/incubator/elasticsearch/values.yaml b/incubator/elasticsearch/values.yaml index 76447568f..65a3e8add 100644 --- a/incubator/elasticsearch/values.yaml +++ b/incubator/elasticsearch/values.yaml @@ -1,73 +1,81 @@ -## Bitnami Elasticsearch image version -## ref: https://hub.docker.com/r/bitnami/elasticsearch/tags/ -## -image: bitnami/elasticsearch:5.5.1-r1 - -## Specify a imagePullPolicy -## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images -## -imagePullPolicy: IfNotPresent - -replicas: 3 - -serviceAccountName: default - -elasticsearchHeapSize: 256m - -## Elasticsearch cluster name -## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables -## -elasticsearchClusterName: elasticsearch-cluster - -## Elasticsearch port -## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables -## -elasticsearchPortNumber: 9200 - -## Elasticsearch Node to Node port -## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables -## -elasticsearchNodePortNumber: 9300 - -elasticsearchPlugins: io.fabric8:elasticsearch-cloud-kubernetes:5.5.1 - -## Kubernetes configuration -## For minikube, set this to NodePort, elsewhere use LoadBalancer -## -serviceType: ClusterIP - -## Enable persistence using Persistent Volume Claims -## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ -## -persistence: - ## If true, use a Persistent Volume Claim, If false, use emptyDir +image: + ## Elasticsearch image + ## ref: https://hub.docker.com/r/bitnami/elasticsearch/tags/ + name: bitnami/elasticsearch + tag: 5.5.2-r0 + ## Specify a imagePullPolicy + ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images ## - enabled: true + pullPolicy: IfNotPresent - ## Persistent Volume Claim annotations +service: + ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## - annotations: {} + type: ClusterIP + port: + ## Elasticsearch REST port + ## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables + ## + http: 9200 + ## Elasticsearch transport port + ## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables + ## + transport: 9300 - ## Persistent Volume Storage Class - ## If defined, storageClassName: - ## If set to "-", storageClassName: "", which disables dynamic provisioning - ## If undefined (the default) or set to null, no storageClassName spec is - ## set, choosing the default provisioner. (gp2 on AWS, standard on - ## GKE, AWS & OpenStack) +cluster: + ## Elasticsearch cluster name + ## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables ## - # storageClass: "-" + name: elasticsearch-cluster + serviceAccountName: default + plugins: io.fabric8:elasticsearch-cloud-kubernetes:5.5.2 + config: - ## Persistent Volume Access Mode - accessModes: - - ReadWriteOnce +node: + master: + replicas: 1 + heapSize: 256m + ## Configure resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + resources: + requests: + memory: "256Mi" - ## Persistent Volume size - ## - size: 8Gi + data: + replicas: 3 + heapSize: 256m + ## Configure resource requests and limits + ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ + ## + resources: + requests: + memory: "256Mi" + ## Enable persistence using Persistent Volume Claims + ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ + ## + persistence: + ## If true, use a Persistent Volume Claim, If false, use emptyDir + ## + enabled: true -elasticsearchConfig: + ## Persistent Volume Claim annotations + ## + annotations: {} -## Configure resource requests and limits -## ref: http://kubernetes.io/docs/user-guide/compute-resources/ -## -resources: {} + ## Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + + ## Persistent Volume Access Mode + accessModes: + - ReadWriteOnce + + ## Persistent Volume size + ## + size: 8Gi From 788099f1e12618a376d419d3755a02b7d7edd56c Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Thu, 31 Aug 2017 14:42:13 +0530 Subject: [PATCH 05/19] elasticsearch: make node names configurable --- .../elasticsearch/templates/_helpers.tpl | 19 +++++++++++++++++++ .../templates/data-statefulset.yaml | 4 ++-- .../templates/master-deploy.yaml | 2 +- incubator/elasticsearch/values.yaml | 2 ++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/incubator/elasticsearch/templates/_helpers.tpl b/incubator/elasticsearch/templates/_helpers.tpl index f0d83d2ed..0e40fa7b2 100644 --- a/incubator/elasticsearch/templates/_helpers.tpl +++ b/incubator/elasticsearch/templates/_helpers.tpl @@ -14,3 +14,22 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Create a default fully qualified master name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "master.fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s-%s" .Release.Name $name .Values.node.master.name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified data name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +*/}} +{{- define "data.fullname" -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- printf "%s-%s-%s" .Release.Name $name .Values.node.data.name | trunc 63 | trimSuffix "-" -}} +{{- end -}} + diff --git a/incubator/elasticsearch/templates/data-statefulset.yaml b/incubator/elasticsearch/templates/data-statefulset.yaml index 42133b8da..6d0a7af8b 100644 --- a/incubator/elasticsearch/templates/data-statefulset.yaml +++ b/incubator/elasticsearch/templates/data-statefulset.yaml @@ -1,7 +1,7 @@ apiVersion: apps/v1beta1 kind: StatefulSet metadata: - name: "{{ template "fullname" . }}-data" + name: "{{ template "data.fullname" . }}" labels: app: "{{ template "name" . }}" chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" @@ -9,7 +9,7 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - serviceName: "{{ template "fullname" . }}-data" + serviceName: "{{ template "data.fullname" . }}" replicas: {{ .Values.node.data.replicas }} template: metadata: diff --git a/incubator/elasticsearch/templates/master-deploy.yaml b/incubator/elasticsearch/templates/master-deploy.yaml index f808f6e6f..6227357cf 100644 --- a/incubator/elasticsearch/templates/master-deploy.yaml +++ b/incubator/elasticsearch/templates/master-deploy.yaml @@ -1,7 +1,7 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: "{{ template "fullname" . }}-master" + name: "{{ template "master.fullname" . }}" labels: app: "{{ template "name" . }}" chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" diff --git a/incubator/elasticsearch/values.yaml b/incubator/elasticsearch/values.yaml index 65a3e8add..41f9a1aaa 100644 --- a/incubator/elasticsearch/values.yaml +++ b/incubator/elasticsearch/values.yaml @@ -33,6 +33,7 @@ cluster: node: master: + name: master replicas: 1 heapSize: 256m ## Configure resource requests and limits @@ -43,6 +44,7 @@ node: memory: "256Mi" data: + name: data replicas: 3 heapSize: 256m ## Configure resource requests and limits From 5053ea4ab33d2a5f7db0b6ea6e1fff3fab5aaf62 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 6 Sep 2017 11:19:08 +0530 Subject: [PATCH 06/19] elasticsearch: cleanup --- incubator/elasticsearch/templates/cm.yaml | 14 ++++++++++---- incubator/elasticsearch/values.yaml | 6 ++++++ 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/incubator/elasticsearch/templates/cm.yaml b/incubator/elasticsearch/templates/cm.yaml index 7fc85da18..dfe83574c 100644 --- a/incubator/elasticsearch/templates/cm.yaml +++ b/incubator/elasticsearch/templates/cm.yaml @@ -10,15 +10,21 @@ metadata: data: elasticsearch_custom.yml: |- - node.master: ${NODE_MASTER} - node.data: ${NODE_DATA} + node: + master: ${NODE_MASTER} + data: ${NODE_DATA} cloud: kubernetes: service: ${SERVICE} namespace: ${KUBERNETES_NAMESPACE} - discovery.zen.hosts_provider: kubernetes - plugin.mandatory: discovery-kubernetes + + discovery: + zen: + hosts_provider: kubernetes + + plugin: + mandatory: discovery-kubernetes {{- if .Values.cluster.config }} {{ toYaml .Values.cluster.config | indent 4 }} diff --git a/incubator/elasticsearch/values.yaml b/incubator/elasticsearch/values.yaml index 41f9a1aaa..f439d8a89 100644 --- a/incubator/elasticsearch/values.yaml +++ b/incubator/elasticsearch/values.yaml @@ -27,8 +27,14 @@ cluster: ## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables ## name: elasticsearch-cluster + ## The serviceAccountName to be used, required by the elasticsearch-cloud-kubernetes plugin serviceAccountName: default + ## Comma seperated list of plugins + ## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables + ## plugins: io.fabric8:elasticsearch-cloud-kubernetes:5.5.2 + ## Customize elasticsearch configuration + ## ref: https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html config: node: From e80757771726844817d263dbb93e3b9663bf091b Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 6 Sep 2017 11:21:18 +0530 Subject: [PATCH 07/19] elasticsearch: set `minimum_master_nodes` to 2 fixes master node election at start up --- incubator/elasticsearch/templates/cm.yaml | 1 + incubator/elasticsearch/values.yaml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/incubator/elasticsearch/templates/cm.yaml b/incubator/elasticsearch/templates/cm.yaml index dfe83574c..5c0dba24f 100644 --- a/incubator/elasticsearch/templates/cm.yaml +++ b/incubator/elasticsearch/templates/cm.yaml @@ -22,6 +22,7 @@ data: discovery: zen: hosts_provider: kubernetes + minimum_master_nodes: 2 plugin: mandatory: discovery-kubernetes diff --git a/incubator/elasticsearch/values.yaml b/incubator/elasticsearch/values.yaml index f439d8a89..4fd2c3082 100644 --- a/incubator/elasticsearch/values.yaml +++ b/incubator/elasticsearch/values.yaml @@ -40,7 +40,7 @@ cluster: node: master: name: master - replicas: 1 + replicas: 2 heapSize: 256m ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ From edd67e5c911210b99620546f3475779e0a30ad16 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 6 Sep 2017 11:23:29 +0530 Subject: [PATCH 08/19] elasticsearch: increase default heapSize of data processing nodes --- incubator/elasticsearch/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/incubator/elasticsearch/values.yaml b/incubator/elasticsearch/values.yaml index 4fd2c3082..db1dbab00 100644 --- a/incubator/elasticsearch/values.yaml +++ b/incubator/elasticsearch/values.yaml @@ -52,13 +52,13 @@ node: data: name: data replicas: 3 - heapSize: 256m + heapSize: 1024m ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ ## resources: requests: - memory: "256Mi" + memory: "512Mi" ## Enable persistence using Persistent Volume Claims ## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ ## From 81fd76ca3b7116218027167310cf951578d79365 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 6 Sep 2017 15:31:20 +0530 Subject: [PATCH 09/19] elasticsearch: bump to `5.5.2-r1` for user defined config support --- incubator/elasticsearch/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/incubator/elasticsearch/values.yaml b/incubator/elasticsearch/values.yaml index db1dbab00..6ea8f4bb7 100644 --- a/incubator/elasticsearch/values.yaml +++ b/incubator/elasticsearch/values.yaml @@ -2,7 +2,7 @@ image: ## Elasticsearch image ## ref: https://hub.docker.com/r/bitnami/elasticsearch/tags/ name: bitnami/elasticsearch - tag: 5.5.2-r0 + tag: 5.5.2-r1 ## Specify a imagePullPolicy ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images ## From 7609e47a77acc6f4ebff6cdc6625cec7bff4be7c Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 6 Sep 2017 15:54:18 +0530 Subject: [PATCH 10/19] elasticsearch: add service to expose only the http endpoint of master nodes --- .../templates/data-statefulset.yaml | 2 +- .../templates/master-deploy.yaml | 2 +- incubator/elasticsearch/templates/svc.yaml | 24 +++++++++++++++---- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/incubator/elasticsearch/templates/data-statefulset.yaml b/incubator/elasticsearch/templates/data-statefulset.yaml index 6d0a7af8b..c1cb0791b 100644 --- a/incubator/elasticsearch/templates/data-statefulset.yaml +++ b/incubator/elasticsearch/templates/data-statefulset.yaml @@ -32,7 +32,7 @@ spec: imagePullPolicy: "{{ .Values.image.pullPolicy }}" env: - name: SERVICE - value: "{{ template "fullname" . }}" + value: "{{ template "fullname" . }}-transport" - name: KUBERNETES_NAMESPACE value: "{{ .Release.Namespace }}" - name: NODE_MASTER diff --git a/incubator/elasticsearch/templates/master-deploy.yaml b/incubator/elasticsearch/templates/master-deploy.yaml index 6227357cf..2e977920c 100644 --- a/incubator/elasticsearch/templates/master-deploy.yaml +++ b/incubator/elasticsearch/templates/master-deploy.yaml @@ -31,7 +31,7 @@ spec: imagePullPolicy: "{{ .Values.image.pullPolicy }}" env: - name: SERVICE - value: "{{ template "fullname" . }}" + value: "{{ template "fullname" . }}-transport" - name: KUBERNETES_NAMESPACE value: "{{ .Release.Namespace }}" - name: NODE_MASTER diff --git a/incubator/elasticsearch/templates/svc.yaml b/incubator/elasticsearch/templates/svc.yaml index f1b87ea96..8ef24e21d 100644 --- a/incubator/elasticsearch/templates/svc.yaml +++ b/incubator/elasticsearch/templates/svc.yaml @@ -1,7 +1,26 @@ apiVersion: v1 kind: Service metadata: - name: "{{ template "fullname" . }}" + name: "{{ template "fullname" . }}-transport" + labels: + app: "{{ template "name" . }}" + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + ports: + - name: "transport" + port: {{ .Values.service.port.transport }} + targetPort: "transport" + selector: + app: "{{ template "name" . }}" + release: "{{ .Release.Name }}" + component: "master" +--- +apiVersion: v1 +kind: Service +metadata: + name: "{{ template "fullname" . }}-http" labels: app: "{{ template "name" . }}" chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" @@ -13,9 +32,6 @@ spec: - name: "http" port: {{ .Values.service.port.http }} targetPort: "http" - - name: "transport" - port: {{ .Values.service.port.transport }} - targetPort: "transport" selector: app: "{{ template "name" . }}" release: "{{ .Release.Name }}" From da8b35ce75180de0e771ee945cca1b7882a095a4 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 6 Sep 2017 16:07:30 +0530 Subject: [PATCH 11/19] elasticsearch: specify default values for `node.master` and `node.data` in configMap --- incubator/elasticsearch/templates/cm.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/incubator/elasticsearch/templates/cm.yaml b/incubator/elasticsearch/templates/cm.yaml index 5c0dba24f..92d8247d2 100644 --- a/incubator/elasticsearch/templates/cm.yaml +++ b/incubator/elasticsearch/templates/cm.yaml @@ -11,8 +11,8 @@ data: elasticsearch_custom.yml: |- node: - master: ${NODE_MASTER} - data: ${NODE_DATA} + master: ${NODE_MASTER:true} + data: ${NODE_DATA:true} cloud: kubernetes: From 350ba542764deca185b552451aa32fcfc9c83001 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 6 Sep 2017 16:26:16 +0530 Subject: [PATCH 12/19] elasticsearch: moved `plugins` and `config` params under `node` key --- incubator/elasticsearch/templates/cm.yaml | 2 +- incubator/elasticsearch/templates/data-statefulset.yaml | 2 +- incubator/elasticsearch/templates/master-deploy.yaml | 2 +- incubator/elasticsearch/values.yaml | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/incubator/elasticsearch/templates/cm.yaml b/incubator/elasticsearch/templates/cm.yaml index 92d8247d2..ec242cfcc 100644 --- a/incubator/elasticsearch/templates/cm.yaml +++ b/incubator/elasticsearch/templates/cm.yaml @@ -28,5 +28,5 @@ data: mandatory: discovery-kubernetes {{- if .Values.cluster.config }} -{{ toYaml .Values.cluster.config | indent 4 }} +{{ toYaml .Values.node.config | indent 4 }} {{- end }} diff --git a/incubator/elasticsearch/templates/data-statefulset.yaml b/incubator/elasticsearch/templates/data-statefulset.yaml index c1cb0791b..33e203714 100644 --- a/incubator/elasticsearch/templates/data-statefulset.yaml +++ b/incubator/elasticsearch/templates/data-statefulset.yaml @@ -46,7 +46,7 @@ spec: - name: ELASTICSEARCH_NODE_PORT_NUMBER value: "{{ .Values.service.port.transport }}" - name: ELASTICSEARCH_PLUGINS - value: "{{ .Values.cluster.plugins }}" + value: "{{ .Values.node.plugins }}" - name: ES_JAVA_OPTS value: "-Djava.net.preferIPv4Stack=true -Xms{{ .Values.node.data.heapSize }} -Xmx{{ .Values.node.data.heapSize }}" ports: diff --git a/incubator/elasticsearch/templates/master-deploy.yaml b/incubator/elasticsearch/templates/master-deploy.yaml index 2e977920c..a94dd95eb 100644 --- a/incubator/elasticsearch/templates/master-deploy.yaml +++ b/incubator/elasticsearch/templates/master-deploy.yaml @@ -45,7 +45,7 @@ spec: - name: ELASTICSEARCH_NODE_PORT_NUMBER value: "{{ .Values.service.port.transport }}" - name: ELASTICSEARCH_PLUGINS - value: "{{ .Values.cluster.plugins }}" + value: "{{ .Values.node.plugins }}" - name: ES_JAVA_OPTS value: "-Djava.net.preferIPv4Stack=true -Xms{{ .Values.node.master.heapSize }} -Xmx{{ .Values.node.master.heapSize }}" ports: diff --git a/incubator/elasticsearch/values.yaml b/incubator/elasticsearch/values.yaml index 6ea8f4bb7..922a39a2f 100644 --- a/incubator/elasticsearch/values.yaml +++ b/incubator/elasticsearch/values.yaml @@ -29,6 +29,8 @@ cluster: name: elasticsearch-cluster ## The serviceAccountName to be used, required by the elasticsearch-cloud-kubernetes plugin serviceAccountName: default + +node: ## Comma seperated list of plugins ## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables ## @@ -37,7 +39,6 @@ cluster: ## ref: https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html config: -node: master: name: master replicas: 2 From 30b19ffa3e6ad5c2b98c9eb2060fbcf92de98b16 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 6 Sep 2017 16:32:08 +0530 Subject: [PATCH 13/19] elasticsearch: remove pod http and transport ports configuration options --- .../elasticsearch/templates/data-statefulset.yaml | 8 ++++---- incubator/elasticsearch/templates/master-deploy.yaml | 8 ++++---- incubator/elasticsearch/templates/svc.yaml | 2 +- incubator/elasticsearch/values.yaml | 10 +++------- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/incubator/elasticsearch/templates/data-statefulset.yaml b/incubator/elasticsearch/templates/data-statefulset.yaml index 33e203714..01ba56a5b 100644 --- a/incubator/elasticsearch/templates/data-statefulset.yaml +++ b/incubator/elasticsearch/templates/data-statefulset.yaml @@ -42,18 +42,18 @@ spec: - name: ELASTICSEARCH_CLUSTER_NAME value: "{{ .Values.cluster.name }}" - name: ELASTICSEARCH_PORT_NUMBER - value: "{{ .Values.service.port.http }}" + value: "9200" - name: ELASTICSEARCH_NODE_PORT_NUMBER - value: "{{ .Values.service.port.transport }}" + value: "9300" - name: ELASTICSEARCH_PLUGINS value: "{{ .Values.node.plugins }}" - name: ES_JAVA_OPTS value: "-Djava.net.preferIPv4Stack=true -Xms{{ .Values.node.data.heapSize }} -Xmx{{ .Values.node.data.heapSize }}" ports: - name: "http" - containerPort: {{ .Values.service.port.http }} + containerPort: 9200 - name: transport - containerPort: {{ .Values.service.port.transport }} + containerPort: 9300 livenessProbe: httpGet: path: /_cluster/health?local=true diff --git a/incubator/elasticsearch/templates/master-deploy.yaml b/incubator/elasticsearch/templates/master-deploy.yaml index a94dd95eb..fdf7f74f0 100644 --- a/incubator/elasticsearch/templates/master-deploy.yaml +++ b/incubator/elasticsearch/templates/master-deploy.yaml @@ -41,18 +41,18 @@ spec: - name: ELASTICSEARCH_CLUSTER_NAME value: "{{ .Values.cluster.name }}" - name: ELASTICSEARCH_PORT_NUMBER - value: "{{ .Values.service.port.http }}" + value: "9200" - name: ELASTICSEARCH_NODE_PORT_NUMBER - value: "{{ .Values.service.port.transport }}" + value: "9300" - name: ELASTICSEARCH_PLUGINS value: "{{ .Values.node.plugins }}" - name: ES_JAVA_OPTS value: "-Djava.net.preferIPv4Stack=true -Xms{{ .Values.node.master.heapSize }} -Xmx{{ .Values.node.master.heapSize }}" ports: - name: "http" - containerPort: {{ .Values.service.port.http }} + containerPort: 9200 - name: transport - containerPort: {{ .Values.service.port.transport }} + containerPort: 9300 livenessProbe: httpGet: path: /_cluster/health?local=true diff --git a/incubator/elasticsearch/templates/svc.yaml b/incubator/elasticsearch/templates/svc.yaml index 8ef24e21d..30ef03680 100644 --- a/incubator/elasticsearch/templates/svc.yaml +++ b/incubator/elasticsearch/templates/svc.yaml @@ -10,7 +10,7 @@ metadata: spec: ports: - name: "transport" - port: {{ .Values.service.port.transport }} + port: 9300 targetPort: "transport" selector: app: "{{ template "name" . }}" diff --git a/incubator/elasticsearch/values.yaml b/incubator/elasticsearch/values.yaml index 922a39a2f..09cc152f9 100644 --- a/incubator/elasticsearch/values.yaml +++ b/incubator/elasticsearch/values.yaml @@ -12,15 +12,11 @@ service: ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## type: ClusterIP + ## Elasticsearch REST port + ## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables + ## port: - ## Elasticsearch REST port - ## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables - ## http: 9200 - ## Elasticsearch transport port - ## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables - ## - transport: 9300 cluster: ## Elasticsearch cluster name From 3110e95c40a14d2ff46f7e5c4679e779e410e9f0 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 6 Sep 2017 17:01:48 +0530 Subject: [PATCH 14/19] elasticsearch: fix NOTES.txt --- incubator/elasticsearch/templates/NOTES.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/incubator/elasticsearch/templates/NOTES.txt b/incubator/elasticsearch/templates/NOTES.txt index 3ebdef4d2..e53bb8e70 100644 --- a/incubator/elasticsearch/templates/NOTES.txt +++ b/incubator/elasticsearch/templates/NOTES.txt @@ -7,31 +7,32 @@ Elasticsearch service externally. Please note that Elasticsearch does not implement a authentication mechanism to secure your cluster. - For security reasons, we strongly suggest that you switch to using "ClusterIP" or "NodePort". + For security reasons, we strongly suggest that you switch to "ClusterIP" + or "NodePort". ------------------------------------------------------------------------------- {{- end }} ** Please be patient while the chart is being deployed ** - Elasticsearch can be accessed within the cluster on port {{ .Values.service.port.http }} at {{ template "fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local + Elasticsearch can be accessed within the cluster on port {{ .Values.service.port.http }} at {{ template "fullname" . }}-http.{{ .Release.Namespace }}.svc.cluster.local To access from outside the cluster execute the following commands: {{- if contains "NodePort" .Values.service.type }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }}) + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }}-http) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT/ {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. - Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }}' + Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }}-http' - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }}-http -o jsonpath='{.status.loadBalancer.ingress[0].ip}') echo http://$SERVICE_IP:{{ .Values.service.port.http }}/ {{- else if contains "ClusterIP" .Values.service.type }} - export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") + export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "name" . }},release={{ .Release.Name }},component=master" -o jsonpath="{.items[0].metadata.name}") echo http://127.0.0.1:{{ .Values.service.port.http }}/ - kubectl port-forward $POD_NAME {{ .Values.service.port.http }}:{{ .Values.service.port.http }} + kubectl port-forward $POD_NAME {{ .Values.service.port.http }}:9200 {{- end }} From 638b3bf38570dac941b5a8c985da809af6705b1a Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 6 Sep 2017 17:04:39 +0530 Subject: [PATCH 15/19] elasticsearch: moved `port` config under `cluster` key --- incubator/elasticsearch/templates/NOTES.txt | 8 ++++---- incubator/elasticsearch/templates/svc.yaml | 2 +- incubator/elasticsearch/values.yaml | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/incubator/elasticsearch/templates/NOTES.txt b/incubator/elasticsearch/templates/NOTES.txt index e53bb8e70..d8ded42c6 100644 --- a/incubator/elasticsearch/templates/NOTES.txt +++ b/incubator/elasticsearch/templates/NOTES.txt @@ -14,7 +14,7 @@ ** Please be patient while the chart is being deployed ** - Elasticsearch can be accessed within the cluster on port {{ .Values.service.port.http }} at {{ template "fullname" . }}-http.{{ .Release.Namespace }}.svc.cluster.local + Elasticsearch can be accessed within the cluster on port {{ .Values.cluster.port.http }} at {{ template "fullname" . }}-http.{{ .Release.Namespace }}.svc.cluster.local To access from outside the cluster execute the following commands: @@ -29,10 +29,10 @@ Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "fullname" . }}-http' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }}-http -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - echo http://$SERVICE_IP:{{ .Values.service.port.http }}/ + echo http://$SERVICE_IP:{{ .Values.cluster.port.http }}/ {{- else if contains "ClusterIP" .Values.service.type }} export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "name" . }},release={{ .Release.Name }},component=master" -o jsonpath="{.items[0].metadata.name}") - echo http://127.0.0.1:{{ .Values.service.port.http }}/ - kubectl port-forward $POD_NAME {{ .Values.service.port.http }}:9200 + echo http://127.0.0.1:{{ .Values.cluster.port.http }}/ + kubectl port-forward $POD_NAME {{ .Values.cluster.port.http }}:9200 {{- end }} diff --git a/incubator/elasticsearch/templates/svc.yaml b/incubator/elasticsearch/templates/svc.yaml index 30ef03680..acfc25327 100644 --- a/incubator/elasticsearch/templates/svc.yaml +++ b/incubator/elasticsearch/templates/svc.yaml @@ -30,7 +30,7 @@ spec: type: "{{ .Values.service.type }}" ports: - name: "http" - port: {{ .Values.service.port.http }} + port: {{ .Values.cluster.port.http }} targetPort: "http" selector: app: "{{ template "name" . }}" diff --git a/incubator/elasticsearch/values.yaml b/incubator/elasticsearch/values.yaml index 09cc152f9..3df653dae 100644 --- a/incubator/elasticsearch/values.yaml +++ b/incubator/elasticsearch/values.yaml @@ -12,17 +12,17 @@ service: ## For minikube, set this to NodePort, elsewhere use LoadBalancer ## type: ClusterIP - ## Elasticsearch REST port - ## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables - ## - port: - http: 9200 cluster: ## Elasticsearch cluster name ## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables ## name: elasticsearch-cluster + ## Elasticsearch REST port + ## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables + ## + port: + http: 9200 ## The serviceAccountName to be used, required by the elasticsearch-cloud-kubernetes plugin serviceAccountName: default From 1bc8c115a66303222f549466c2ca05cf8adab0f5 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 6 Sep 2017 17:09:32 +0530 Subject: [PATCH 16/19] elasticsearch: moved `serviceAccountName` config under `node` key --- incubator/elasticsearch/templates/data-statefulset.yaml | 2 +- incubator/elasticsearch/templates/master-deploy.yaml | 2 +- incubator/elasticsearch/values.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/incubator/elasticsearch/templates/data-statefulset.yaml b/incubator/elasticsearch/templates/data-statefulset.yaml index 01ba56a5b..c07451a9a 100644 --- a/incubator/elasticsearch/templates/data-statefulset.yaml +++ b/incubator/elasticsearch/templates/data-statefulset.yaml @@ -18,7 +18,7 @@ spec: component: "data" release: "{{ .Release.Name }}" spec: - serviceAccountName: "{{ .Values.cluster.serviceAccountName }}" + serviceAccountName: "{{ .Values.node.serviceAccountName }}" initContainers: - name: sysctl image: "{{ .Values.image.name }}:{{ .Values.image.tag }}" diff --git a/incubator/elasticsearch/templates/master-deploy.yaml b/incubator/elasticsearch/templates/master-deploy.yaml index fdf7f74f0..58cecf333 100644 --- a/incubator/elasticsearch/templates/master-deploy.yaml +++ b/incubator/elasticsearch/templates/master-deploy.yaml @@ -17,7 +17,7 @@ spec: component: "master" release: "{{ .Release.Name }}" spec: - serviceAccountName: "{{ .Values.cluster.serviceAccountName }}" + serviceAccountName: "{{ .Values.node.serviceAccountName }}" initContainers: - name: sysctl image: "{{ .Values.image.name }}:{{ .Values.image.tag }}" diff --git a/incubator/elasticsearch/values.yaml b/incubator/elasticsearch/values.yaml index 3df653dae..1b85df2dc 100644 --- a/incubator/elasticsearch/values.yaml +++ b/incubator/elasticsearch/values.yaml @@ -23,10 +23,10 @@ cluster: ## port: http: 9200 - ## The serviceAccountName to be used, required by the elasticsearch-cloud-kubernetes plugin - serviceAccountName: default node: + ## The serviceAccountName to be used, required by the elasticsearch-cloud-kubernetes plugin + serviceAccountName: default ## Comma seperated list of plugins ## ref: https://github.com/bitnami/bitnami-docker-elasticsearch#environment-variables ## From 923cdf7c0be9baf66eabec80cce35a6103e860bb Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 6 Sep 2017 17:12:51 +0530 Subject: [PATCH 17/19] elasticsearch: configure `node.name` to value of `HOSTNAME` --- incubator/elasticsearch/templates/cm.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/incubator/elasticsearch/templates/cm.yaml b/incubator/elasticsearch/templates/cm.yaml index ec242cfcc..6af9df8e9 100644 --- a/incubator/elasticsearch/templates/cm.yaml +++ b/incubator/elasticsearch/templates/cm.yaml @@ -11,6 +11,7 @@ data: elasticsearch_custom.yml: |- node: + name: ${HOSTNAME} master: ${NODE_MASTER:true} data: ${NODE_DATA:true} From 7c1b219ed485ff928d67d7cb22848c0667cc4e5a Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 6 Sep 2017 17:37:09 +0530 Subject: [PATCH 18/19] elasticsearch: lower master node heapsize to `128m` --- incubator/elasticsearch/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/incubator/elasticsearch/values.yaml b/incubator/elasticsearch/values.yaml index 1b85df2dc..dd649852d 100644 --- a/incubator/elasticsearch/values.yaml +++ b/incubator/elasticsearch/values.yaml @@ -38,7 +38,7 @@ node: master: name: master replicas: 2 - heapSize: 256m + heapSize: 128m ## Configure resource requests and limits ## ref: http://kubernetes.io/docs/user-guide/compute-resources/ ## From cbef358e8584769ecb11a69a1aadaea14a41d159 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Wed, 6 Sep 2017 17:39:55 +0530 Subject: [PATCH 19/19] elasticsearch: updated the readme --- incubator/elasticsearch/README.md | 55 +++++++++++++++---------------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/incubator/elasticsearch/README.md b/incubator/elasticsearch/README.md index 651f8e41e..34771d6ac 100644 --- a/incubator/elasticsearch/README.md +++ b/incubator/elasticsearch/README.md @@ -43,29 +43,30 @@ The command removes all the Kubernetes components associated with the chart and The following tables lists the configurable parameters of the Elasticsearch chart and their default values. -| Parameter | Description | Default | -|--------------------------------------|----------------------------------------------------|--------------------------------------------------------| -| `image.name` | Elasticsearch image name | `bitnami/elasticsearch` | -| `image.tag` | Elasticsearch image tag | `{VERSION}` | -| `image.pullPolicy` | Image pull policy | `IfNotPresent` | -| `service.type` | Kubernetes Service type | `ClusterIP` | -| `service.port.http` | Elasticsearch HTTP port | `9200` | -| `service.port.transport` | Elasticsearch transport port | `9300` | -| `cluster.name` | Elasticsearch cluster name | `elasticsearch-cluster` | -| `cluster.serviceAccountName` | Kubernetes service account | `default` | -| `cluster.plugins` | Elasticsearch plugins | `io.fabric8:elasticsearch-cloud-kubernetes` (required) | -| `cluster.config` | Elasticsearch custom configuration | `` | -| `node.master.replicas` | | `1` | -| `node.master.heapSize` | | `256m` | -| `node.master.resources` | CPU/Memory resource requests/limits | `` | -| `node.data.replicas` | | `3` | -| `node.data.heapSize` | | `256m` | -| `node.data.resources` | CPU/Memory resource requests/limits | `` | -| `node.data.persistence.enabled` | Enable persistence using a `PersistentVolumeClaim` | `true` | -| `node.data.persistence.annotations` | Persistent Volume Claim annotations | `{}` | -| `node.data.persistence.storageClass` | Persistent Volume Storage Class | `` | -| `node.data.persistence.accessModes` | Persistent Volume Access Modes | `[ReadWriteOnce]` | -| `node.data.persistence.size` | Persistent Volume Size | `8Gi` | +| Parameter | Description | Default | +|------------------------------------|-------------------------------------------------------|---------------------------------------------------------------------| +| image.name | Elasticsearch image name | `bitnami/elasticsearch` | +| image.tag | Elasticsearch image tag | `{VERSION}` | +| image.pullPolicy | Image pull policy | `IfNotPresent` | +| service.type | Kubernetes service type | `ClusterIP` | +| cluster.name | Elasticsearch cluster name | `elasticsearch-cluster` | +| cluster.port.http | Elasticsearch REST port | `9200` | +| node.serviceAccountName | Kubernetes service account | `default` | +| node.plugins | Elasticsearch node plugins | `io.fabric8:elasticsearch-cloud-kubernetes:5.5.2` (required plugin) | +| node.config | Elasticsearch node custom configuration | `` | +| node.master.name | Master node pod name | `master` | +| node.master.replicas | Desired number of Elasticsearch master eligible nodes | `2` | +| node.master.heapSize | master node heap size | `128m` | +| node.master.resources | CPU/Memory resource requests/limits for master nodes | `{ memory: "256Mi" }` | +| node.data.name | Data node pod name | `data` | +| node.data.replicas | Desired number of Elasticsearch data eligible nodes | `3` | +| node.data.heapSize | data node heap size | `1024m` | +| node.data.resources | CPU/Memory resource requests/limits for data nodes | `{ memory: "512Mi" }` | +| node.data.persistence.enabled | Enable persistence using a `PersistentVolumeClaim` | `true` | +| node.data.persistence.annotations | Persistent Volume Claim annotations | `{}` | +| node.data.persistence.storageClass | Persistent Volume Storage Class | `` | +| node.data.persistence.accessModes | Persistent Volume Access Modes | `[ReadWriteOnce]` | +| node.data.persistence.size | Persistent Volume Size | `8Gi` | The above parameters map to the env variables defined in [bitnami/elasticsearch](http://github.com/bitnami/bitnami-docker-elasticsearch). For more information please refer to the [bitnami/elasticsearch](http://github.com/bitnami/bitnami-docker-elasticsearch) image documentation. @@ -73,11 +74,11 @@ Specify each parameter using the `--set key=value[,key=value]` argument to `helm ```console $ helm install --name my-release \ - --set elasticsearchClusterName=elastic,elasticsearchPortNumber=80 \ + --set cluster.name=elastic,cluster.port.http=8080 \ incubator/elasticsearch ``` -The above command sets the Elasticsearch cluster name and REST api port number to `elastic` and `80` respectively. +The above command sets the Elasticsearch cluster name to `elastic` and REST port number to `8080`. Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, @@ -89,7 +90,5 @@ $ helm install --name my-release -f values.yaml incubator/elasticsearch ## Persistence -The [Bitnami Elasticsearch](https://github.com/bitnami/bitnami-docker-elasticsearch) image stores the Elasticsearch data and configurations at the `/bitnami` path of the container. - -Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. +The [Bitnami Elasticsearch](https://github.com/bitnami/bitnami-docker-elasticsearch) image stores the Elasticsearch data and configurations at the `/bitnami` path of the container. Persistent Volume Claims are used to persist the state of the data processing Elasticsearch nodes. This is known to work in GCE, AWS, and minikube. See the [Configuration](#configuration) section to configure the PVC or to disable persistence.