From ad307f6596aead7a193231ff43a659bec7c3c8c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Sat, 22 Sep 2018 16:44:27 +0200 Subject: [PATCH] [incubator/elasticsearch] added extraInitContainers option (#7587) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * added extraInitContainers option Signed-off-by: André Bauer * added ci test with extrainitcontainers values Signed-off-by: André Bauer * updated elasticsearch to version 6.4.1 Signed-off-by: André Bauer * updated version also in values file Signed-off-by: André Bauer --- incubator/elasticsearch/Chart.yaml | 2 +- incubator/elasticsearch/README.md | 11 ++++++++++- .../elasticsearch/ci/extrainitcontainers-values.yaml | 9 +++++++++ .../elasticsearch/templates/client-deployment.yaml | 3 +++ .../elasticsearch/templates/data-statefulset.yaml | 3 +++ .../elasticsearch/templates/master-statefulset.yaml | 3 +++ incubator/elasticsearch/values.yaml | 3 +++ 7 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 incubator/elasticsearch/ci/extrainitcontainers-values.yaml diff --git a/incubator/elasticsearch/Chart.yaml b/incubator/elasticsearch/Chart.yaml index 543fa02fae..11459795b4 100755 --- a/incubator/elasticsearch/Chart.yaml +++ b/incubator/elasticsearch/Chart.yaml @@ -1,6 +1,6 @@ name: elasticsearch home: https://www.elastic.co/products/elasticsearch -version: 1.7.3 +version: 1.8.0 appVersion: 6.4.1 description: Flexible and powerful open source, distributed real-time search and analytics engine. diff --git a/incubator/elasticsearch/README.md b/incubator/elasticsearch/README.md index d2975ae7cf..f6077c13c3 100644 --- a/incubator/elasticsearch/README.md +++ b/incubator/elasticsearch/README.md @@ -113,6 +113,7 @@ The following table lists the configurable parameters of the elasticsearch chart | `data.tolerations` | Data tolerations | `[]` | | `data.terminationGracePeriodSeconds` | Data termination grace period (seconds) | `3600` | | `data.antiAffinity` | Data anti-affinity policy | `soft` | +| `extraInitContainers` | Additional init container passed through the tpl | `` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. @@ -126,7 +127,7 @@ The YAML value of cluster.config is appended to elasticsearch.yml file for addit ## Application Version -This chart aims to support Elasticsearch v2 and v5 deployments by specifying the `values.yaml` parameter `appVersion`. +This chart aims to support Elasticsearch v2 to v6 deployments by specifying the `values.yaml` parameter `appVersion`. ### Version Specific Features @@ -188,3 +189,11 @@ Create cluster with Storage class `ssd` on Kubernetes 1.5+ ``` $ helm install incubator/elasticsearch --name my-release --set data.storageClass=ssd,data.storage=100Gi ``` + +### Usage of the `tpl` Function + +The `tpl` function allows us to pass string values from `values.yaml` through the templating engine. It is used for the following values: + +* `extraInitContainers` + +It is important that these values be configured as strings. Otherwise, installation will fail. diff --git a/incubator/elasticsearch/ci/extrainitcontainers-values.yaml b/incubator/elasticsearch/ci/extrainitcontainers-values.yaml new file mode 100644 index 0000000000..9ba5471aed --- /dev/null +++ b/incubator/elasticsearch/ci/extrainitcontainers-values.yaml @@ -0,0 +1,9 @@ +extraInitContainers: | + - name: "plugin-install-ingest-attachment" + image: "docker.elastic.co/elasticsearch/elasticsearch-oss:6.4.0" + command: ["/bin/bash"] + args: ["-c", "yes | /usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-attachment"] + - name: "plugin-install-mapper-size" + image: "docker.elastic.co/elasticsearch/elasticsearch-oss:6.4.0" + command: ["/bin/bash"] + args: ["-c", "yes | /usr/share/elasticsearch/bin/elasticsearch-plugin install mapper-size"] diff --git a/incubator/elasticsearch/templates/client-deployment.yaml b/incubator/elasticsearch/templates/client-deployment.yaml index 1e8eda606d..e822582cdb 100644 --- a/incubator/elasticsearch/templates/client-deployment.yaml +++ b/incubator/elasticsearch/templates/client-deployment.yaml @@ -66,6 +66,9 @@ spec: command: ["sysctl", "-w", "vm.max_map_count=262144"] securityContext: privileged: true +{{- if .Values.extraInitContainers }} +{{ tpl .Values.extraInitContainers . | indent 6 }} +{{- end }} containers: - name: elasticsearch env: diff --git a/incubator/elasticsearch/templates/data-statefulset.yaml b/incubator/elasticsearch/templates/data-statefulset.yaml index 50aefe2aaf..a91aefd2d2 100644 --- a/incubator/elasticsearch/templates/data-statefulset.yaml +++ b/incubator/elasticsearch/templates/data-statefulset.yaml @@ -80,6 +80,9 @@ spec: volumeMounts: - mountPath: /usr/share/elasticsearch/data name: data +{{- if .Values.extraInitContainers }} +{{ tpl .Values.extraInitContainers . | indent 6 }} +{{- end }} containers: - name: elasticsearch env: diff --git a/incubator/elasticsearch/templates/master-statefulset.yaml b/incubator/elasticsearch/templates/master-statefulset.yaml index feb3159a8b..cd3aa9e0fa 100644 --- a/incubator/elasticsearch/templates/master-statefulset.yaml +++ b/incubator/elasticsearch/templates/master-statefulset.yaml @@ -80,6 +80,9 @@ spec: volumeMounts: - mountPath: /usr/share/elasticsearch/data name: data +{{- if .Values.extraInitContainers }} +{{ tpl .Values.extraInitContainers . | indent 6 }} +{{- end }} containers: - name: elasticsearch env: diff --git a/incubator/elasticsearch/values.yaml b/incubator/elasticsearch/values.yaml index 3a39be2bc6..948a487b21 100644 --- a/incubator/elasticsearch/values.yaml +++ b/incubator/elasticsearch/values.yaml @@ -119,3 +119,6 @@ data: maxUnavailable: 1 updateStrategy: type: OnDelete + +## Additional init containers +extraInitContainers: |