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

Commit

Permalink
[kibana] - Add additionals labels
Browse files Browse the repository at this point in the history
  • Loading branch information
plumcraft committed Jul 17, 2019
1 parent 581b083 commit e3edaa1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions kibana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`<br>`port: 5601`<br>`nodePort:`<br>`annotations: {}` |
| `labels` | Configurable [label](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) applied to all Kibana pods | `{}` |

## Examples

Expand Down
3 changes: 3 additions & 0 deletions kibana/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 9 additions & 1 deletion kibana/tests/kibana_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
assert c['imagePullPolicy'] == 'Always'

def test_adding_pod_labels():
config = '''
labels:
app.kubernetes.io/name: kibana
'''
r = helm_template(config)
assert r['daemonset'][name]['metadata']['labels']['app.kubernetes.io/name'] == 'kibana'
3 changes: 3 additions & 0 deletions kibana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e3edaa1

Please sign in to comment.