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

Added kibana pod annotations #210

Merged
merged 2 commits into from
Jul 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions kibana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ helm install --name kibana elastic/kibana --version 7.2.0 --set imageTag=7.2.0
| `image` | The Kibana docker image | `docker.elastic.co/kibana/kibana` |
| `imageTag` | The Kibana docker image tag | `7.2.0` |
| `imagePullPolicy` | The Kubernetes [imagePullPolicy](https://kubernetes.io/docs/concepts/containers/images/#updating-images) value | `IfNotPresent` |
| `podAnnotations` | Configurable [annotations](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/) applied to all Kibana pods | `{}` |
| `resources` | Allows you to set the [resources](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/) for the statefulset | `requests.cpu: 100m`<br>`requests.memory: 2Gi`<br>`limits.cpu: 1000m`<br>`limits.memory: 2Gi` |
| `protocol` | The protocol that will be used for the readinessProbe. Change this to `https` if you have `server.ssl.enabled: true` set | `http` |
| `serverHost` | The [`server.host`](https://www.elastic.co/guide/en/kibana/current/settings.html) Kibana setting. This is set explicitly so that the default always matches what comes with the docker image. | `0.0.0.0` |
Expand Down
3 changes: 3 additions & 0 deletions kibana/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ spec:
app: kibana
release: {{ .Release.Name | quote }}
annotations:
{{- range $key, $value := .Values.podAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{/* This forces a restart if the configmap has changed */}}
{{- if .Values.kibanaConfig }}
configchecksum: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum | trunc 63 }}
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 @@ -334,6 +334,14 @@ def test_override_the_serverHost():
assert c['env'][1]['name'] == 'SERVER_HOST'
assert c['env'][1]['value'] == 'localhost'

def test_adding_pod_annotations():
config = '''
podAnnotations:
iam.amazonaws.com/role: es-role
'''
r = helm_template(config)
assert r['deployment'][name]['spec']['template']['metadata']['annotations']['iam.amazonaws.com/role'] == 'es-role'

def test_override_imagePullPolicy():
config = ''

Expand All @@ -347,4 +355,4 @@ 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'
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"

podAnnotations: {}
# iam.amazonaws.com/role: es-cluster

resources:
requests:
cpu: "100m"
Expand Down