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

Commit

Permalink
[kibana] Add envFrom parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
cartonalexandre committed Apr 8, 2020
1 parent 3d781e3 commit 6b567c3
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 @@ -57,6 +57,7 @@ helm install --name kibana elastic/kibana --set imageTag=7.6.2
| `elasticsearchURL` | The URL used to connect to Elasticsearch. Deprecated, needs to be used for Kibana versions < 6.6 | |
| `replicas` | Kubernetes replica count for the deployment (i.e. how many pods) | `1` |
| `extraEnvs` | Extra [environment variables](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/#using-environment-variables-inside-of-your-config) which will be appended to the `env:` definition for the container | `name: NODE_OPTIONS`<br>`value: "--max-old-space-size=1800"` |
| `envFrom` | Templatable string of envFrom to be passed to the [environment from variables](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#configure-all-key-value-pairs-in-a-configmap-as-container-environment-variables) which will be appended to the `envFrom:` definition for the container | `[]` |
| `secretMounts` | Allows you easily mount a secret as a file inside the deployment. Useful for mounting certificates and other secrets. See [values.yaml](https://github.com/elastic/helm-charts/tree/master/kibana/values.yaml) for an example | `[]` |
| `image` | The Kibana docker image | `docker.elastic.co/kibana/kibana` |
| `imageTag` | The Kibana docker image tag | `7.6.2` |
Expand Down
4 changes: 4 additions & 0 deletions kibana/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ spec:
value: "{{ .Values.serverHost }}"
{{- if .Values.extraEnvs }}
{{ toYaml .Values.extraEnvs | indent 10 }}
{{- end }}
{{- if .Values.envFrom }}
envFrom:
{{ toYaml .Values.envFrom | indent 10 }}
{{- end }}
readinessProbe:
{{ toYaml .Values.readinessProbe | indent 10 }}
Expand Down
10 changes: 10 additions & 0 deletions kibana/tests/kibana_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,16 @@ def test_overriding_the_port():

assert r["service"][name]["spec"]["ports"][0]["targetPort"] == 5602

def test_adding_env_from():
config = """
envFrom:
- secretRef:
name: secret-name
"""
r = helm_template(config)
secretRef = r["deployment"][name]["spec"]["template"]["spec"]["containers"][0]["envFrom"][0]["secretRef"]
assert secretRef == {"name": "secret-name"}


def test_adding_image_pull_secrets():
config = """
Expand Down
7 changes: 7 additions & 0 deletions kibana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ extraEnvs:
# - name: MY_ENVIRONMENT_VAR
# value: the_value_goes_here

# Allows you to load environment variables from kubernetes secret or config map
envFrom: []
# - secretRef:
# name: env-secret
# - configMapRef:
# name: config-map

# A list of secrets and their paths to mount inside the pod
# This is useful for mounting certificates for security and for mounting
# the X-Pack license
Expand Down

0 comments on commit 6b567c3

Please sign in to comment.