From fc62de0fa095c95347bdf28fc496e54d4b845bec Mon Sep 17 00:00:00 2001 From: Olivier Lebhard Date: Wed, 17 Jul 2019 17:26:18 +0200 Subject: [PATCH] [kibana] - Add additionals labels --- kibana/README.md | 1 + kibana/templates/deployment.yaml | 3 +++ kibana/tests/kibana_test.py | 10 +++++++++- kibana/values.yaml | 3 +++ 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/kibana/README.md b/kibana/README.md index 873907e6a..19bdc017c 100644 --- a/kibana/README.md +++ b/kibana/README.md @@ -69,6 +69,7 @@ helm install --name kibana elastic/kibana --version 7.2.0 --set imageTag=7.2.0 | `tolerations` | Configurable [tolerations](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) | `[]` | | `ingress` | Configurable [ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/) to expose the Kibana service. See [`values.yaml`](./values.yaml) for an example | `enabled: false` | | `service` | Configurable [service](https://kubernetes.io/docs/concepts/services-networking/service/) to expose the Kibana service. See [`values.yaml`](./values.yaml) for an example | `type: ClusterIP`
`port: 5601`
`nodePort:`
`annotations: {}` | +| `labels` | Configurable [label](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) applied to all Kibana pods | `{}` | ## Examples diff --git a/kibana/templates/deployment.yaml b/kibana/templates/deployment.yaml index e31f5c6e5..95616ec0a 100644 --- a/kibana/templates/deployment.yaml +++ b/kibana/templates/deployment.yaml @@ -5,6 +5,9 @@ metadata: labels: app: {{ .Chart.Name }} release: {{ .Release.Name | quote }} + {{- range $key, $value := .Values.labels }} + {{ $key }}: {{ $value | quote }} + {{- end }} spec: replicas: {{ .Values.replicas }} strategy: diff --git a/kibana/tests/kibana_test.py b/kibana/tests/kibana_test.py index b85315f4a..2446dd75a 100644 --- a/kibana/tests/kibana_test.py +++ b/kibana/tests/kibana_test.py @@ -355,4 +355,12 @@ def test_override_imagePullPolicy(): r = helm_template(config) c = r['deployment'][name]['spec']['template']['spec']['containers'][0] - assert c['imagePullPolicy'] == 'Always' \ No newline at end of file + assert c['imagePullPolicy'] == 'Always' + + def test_adding_pod_labels(): + config = ''' + labels: + app.kubernetes.io/name: kibana + ''' + r = helm_template(config) + assert r['deployment'][name]['metadata']['labels']['app.kubernetes.io/name'] == 'kibana' \ No newline at end of file diff --git a/kibana/values.yaml b/kibana/values.yaml index e34407e23..cf08ef6f8 100755 --- a/kibana/values.yaml +++ b/kibana/values.yaml @@ -24,6 +24,9 @@ image: "docker.elastic.co/kibana/kibana" imageTag: "7.2.0" imagePullPolicy: "IfNotPresent" +# additionals labels +labels: {} + podAnnotations: {} # iam.amazonaws.com/role: es-cluster