Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
[kibana] add extra init containers
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlrt committed Feb 6, 2020
1 parent 8ea88ae commit decd945
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions kibana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions kibana/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 12 additions & 0 deletions kibana/tests/kibana_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions kibana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ extraContainers: ""
# image: busybox
# command: ['echo', 'hey']

extraInitContainers: ""
# - name: dummy-init
# image: busybox
# command: ['echo', 'hey']

updateStrategy:
type: "Recreate"

Expand Down

0 comments on commit decd945

Please sign in to comment.