Skip to content

Commit

Permalink
[incubator/elasticsearch] added extraInitContainers option (helm#7587)
Browse files Browse the repository at this point in the history
* added extraInitContainers option

Signed-off-by: André Bauer <[email protected]>

* added ci test with extrainitcontainers values

Signed-off-by: André Bauer <[email protected]>

* updated elasticsearch to version 6.4.1
Signed-off-by: André Bauer <[email protected]>

* updated version also in values file
Signed-off-by: André Bauer <[email protected]>
  • Loading branch information
monotek authored and k8s-ci-robot committed Sep 22, 2018
1 parent 8af9ba3 commit ad307f6
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion incubator/elasticsearch/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
11 changes: 10 additions & 1 deletion incubator/elasticsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand All @@ -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

Expand Down Expand Up @@ -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.
9 changes: 9 additions & 0 deletions incubator/elasticsearch/ci/extrainitcontainers-values.yaml
Original file line number Diff line number Diff line change
@@ -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"]
3 changes: 3 additions & 0 deletions incubator/elasticsearch/templates/client-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions incubator/elasticsearch/templates/data-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions incubator/elasticsearch/templates/master-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions incubator/elasticsearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,6 @@ data:
maxUnavailable: 1
updateStrategy:
type: OnDelete

## Additional init containers
extraInitContainers: |

0 comments on commit ad307f6

Please sign in to comment.