diff --git a/kibana/README.md b/kibana/README.md index 0208ee3d6..cc819a5c3 100644 --- a/kibana/README.md +++ b/kibana/README.md @@ -83,6 +83,7 @@ helm install --name kibana elastic/kibana --set imageTag=7.5.2 | `lifecycle` | Allows you to add lifecycle configuration. See [values.yaml](https://github.com/elastic/helm-charts/tree/master/kibana/values.yaml) for an example of the formatting. | `{}` | | `fullnameOverride` | Overrides the full name of the resources. If not set the name will default to "`.Release.Name`-`.Values.nameOverride or .Chart.Name`" | `""` | | `extraContainers` | Templatable string of additional containers to be passed to the `tpl` function | `""` | +| `extraInitContainers` | Templatable string of additional containers to be passed to the `tpl` function | `""` | ## Examples diff --git a/kibana/templates/deployment.yaml b/kibana/templates/deployment.yaml index 49a2b7f93..ad563b3f2 100644 --- a/kibana/templates/deployment.yaml +++ b/kibana/templates/deployment.yaml @@ -68,6 +68,10 @@ spec: imagePullSecrets: {{ toYaml .Values.imagePullSecrets | indent 8 }} {{- end }} + {{- if .Values.extraInitContainers }} + initContainers: +{{ tpl .Values.extraInitContainers . | indent 6 }} + {{- end }} containers: - name: kibana securityContext: diff --git a/kibana/tests/kibana_test.py b/kibana/tests/kibana_test.py index 179a9f3cc..1fb68a9b3 100644 --- a/kibana/tests/kibana_test.py +++ b/kibana/tests/kibana_test.py @@ -148,6 +148,18 @@ def test_adding_a_extra_container(): assert {'name': 'do-something', 'image': 'busybox', 'command': ['do', 'something'], } in extraContainer +def test_adding_a_extra_init_container(): + config = ''' +extraInitContainers: | + - name: do-something + image: busybox + command: ['do', 'something'] +''' + r = helm_template(config) + extraInitContainer = r['deployment'][name]['spec']['template']['spec']['initContainers'] + assert {'name': 'do-something', 'image': 'busybox', 'command': ['do', 'something'], } in extraInitContainer + + def test_adding_an_ingress_rule(): config = ''' ingress: diff --git a/kibana/values.yaml b/kibana/values.yaml index cb394eb66..628336462 100755 --- a/kibana/values.yaml +++ b/kibana/values.yaml @@ -78,6 +78,11 @@ extraContainers: "" # image: busybox # command: ['echo', 'hey'] +extraInitContainers: "" +# - name: dummy-init +# image: busybox +# command: ['echo', 'hey'] + updateStrategy: type: "Recreate"