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

Commit

Permalink
[kibana] adding extra volumes and extra volume mounts (elastic#557) (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
DilasserT authored and jmlrt committed Jul 5, 2021
1 parent bf0ed53 commit cb44fec
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kibana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ as a reference. They are also used in the automated testing of this chart.
| `extraContainers` | Templatable string of additional containers to be passed to the `tpl` function | `""` |
| `extraEnvs` | Extra [environment variables][] which will be appended to the `env:` definition for the container | see [values.yaml][] |
| `extraInitContainers` | Templatable string of additional containers to be passed to the `tpl` function | `""` |
| `extraVolumeMounts` | Configuration for additionnal `volumeMounts` | see [values.yaml][] |
| `extraVolumes` | Configuration for additionnal `volumes` | see [values.yaml][] |
| `fullnameOverride` | Overrides the full name of the resources. If not set the name will default to " `.Release.Name` - `.Values.nameOverride orChart.Name` " | `""` |
| `healthCheckPath` | The path used for the readinessProbe to check that Kibana is ready. If you are setting `server.basePath` you will also need to update this to `/${basePath}/app/kibana` | `/app/kibana` |
| `hostAliases` | Configurable [hostAliases][] | `[]` |
Expand Down
6 changes: 6 additions & 0 deletions kibana/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ spec:
configMap:
name: {{ template "kibana.fullname" . }}-config
{{- end }}
{{- if .Values.extraVolumes }}
{{ toYaml .Values.extraVolumes | indent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
Expand Down Expand Up @@ -152,6 +155,9 @@ spec:
mountPath: /usr/share/kibana/config/{{ $path }}
subPath: {{ $path }}
{{- end -}}
{{- if .Values.extraVolumeMounts }}
{{ toYaml .Values.extraVolumeMounts | indent 10 }}
{{- end }}
{{- if .Values.extraContainers }}
# Currently some extra blocks accept strings
# to continue with backwards compatibility this is being kept
Expand Down
23 changes: 23 additions & 0 deletions kibana/tests/kibana_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,29 @@ def test_adding_env_from():
assert secretRef == {"name": "secret-name"}


def test_adding_an_extra_volume_with_volume_mount():
config = """
extraVolumes:
- name: extras
emptyDir: {}
extraVolumeMounts:
- name: extras
mountPath: /usr/share/extras
readOnly: true
"""
r = helm_template(config)
extraVolume = r["deployment"][name]["spec"]["template"]["spec"]["volumes"]
assert {"name": "extras", "emptyDir": {}} in extraVolume
extraVolumeMounts = r["deployment"][name]["spec"]["template"]["spec"]["containers"][
0
]["volumeMounts"]
assert {
"name": "extras",
"mountPath": "/usr/share/extras",
"readOnly": True,
} in extraVolumeMounts


def test_adding_image_pull_secrets():
config = """
imagePullSecrets:
Expand Down
11 changes: 11 additions & 0 deletions kibana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,17 @@ priorityClassName: ""

httpPort: 5601

extraVolumes:
[]
# - name: extras
# emptyDir: {}

extraVolumeMounts:
[]
# - name: extras
# mountPath: /usr/share/extras
# readOnly: true
#
extraContainers: ""
# - name: dummy-init
# image: busybox
Expand Down

0 comments on commit cb44fec

Please sign in to comment.