diff --git a/kibana/README.md b/kibana/README.md index 1ea5b97de..8f6a70e8d 100644 --- a/kibana/README.md +++ b/kibana/README.md @@ -82,6 +82,7 @@ as a reference. They are also used in the automated testing of this chart. | Parameter | Description | Default | |-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------| | `affinity` | Configurable [affinity][] | `{}` | +| `annotations` | Configurable [annotations][] on the deployment object | `{}` | | `elasticsearchHosts` | The URLs used to connect to Elasticsearch | `http://elasticsearch-master:9200` | | `envFrom` | Templatable string to be passed to the [environment from variables][] which will be appended to the `envFrom:` definition for the container | `[]` | | `extraContainers` | Templatable string of additional containers to be passed to the `tpl` function | `""` | diff --git a/kibana/templates/deployment.yaml b/kibana/templates/deployment.yaml index 71703271f..ae6e83d0a 100644 --- a/kibana/templates/deployment.yaml +++ b/kibana/templates/deployment.yaml @@ -3,6 +3,12 @@ kind: Deployment metadata: name: {{ template "kibana.fullname" . }} labels: {{ include "kibana.labels" . | nindent 4 }} + {{- if .Values.annotations }} + annotations: + {{- range $key, $value := .Values.annotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} spec: replicas: {{ .Values.replicas }} strategy: diff --git a/kibana/tests/kibana_test.py b/kibana/tests/kibana_test.py index a7411f358..a14c73e51 100644 --- a/kibana/tests/kibana_test.py +++ b/kibana/tests/kibana_test.py @@ -756,3 +756,14 @@ def test_hostaliases(): r = helm_template(config) hostAliases = r["deployment"][name]["spec"]["template"]["spec"]["hostAliases"] assert {"ip": "127.0.0.1", "hostnames": ["foo.local", "bar.local"]} in hostAliases + +def test_adding_annotations(): + config = """ + annotations: + iam.amazonaws.com/role: es-role + """ + r = helm_template(config) + assert ( + r["deployment"][name]["metadata"]["annotations"]["iam.amazonaws.com/role"] + == "es-role" + ) \ No newline at end of file diff --git a/kibana/values.yaml b/kibana/values.yaml index a97491e98..bd9be8159 100755 --- a/kibana/values.yaml +++ b/kibana/values.yaml @@ -41,6 +41,8 @@ imagePullPolicy: "IfNotPresent" # additionals labels labels: {} +annotations: {} + podAnnotations: {} # iam.amazonaws.com/role: es-cluster