diff --git a/kibana/README.md b/kibana/README.md index fea6006fb..09184cabe 100644 --- a/kibana/README.md +++ b/kibana/README.md @@ -65,6 +65,7 @@ helm install --name kibana elastic/kibana --version 7.1.1 --set imageTag=7.1.1 | `nodeSelector` | Configurable [nodeSelector](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) so that you can target specific nodes for your Kibana instances | `{}` | | `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`
`annotations: {}` | ## Examples diff --git a/kibana/templates/service.yaml b/kibana/templates/service.yaml index 24adfb7b4..86dda2f3a 100644 --- a/kibana/templates/service.yaml +++ b/kibana/templates/service.yaml @@ -7,6 +7,10 @@ metadata: app: {{ .Chart.Name }} release: {{ .Release.Name | quote }} heritage: {{ .Release.Service }} +{{- with .Values.service.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} spec: type: {{ .Values.service.type }} ports: diff --git a/kibana/tests/kibana_test.py b/kibana/tests/kibana_test.py index 58f775b82..defc23022 100644 --- a/kibana/tests/kibana_test.py +++ b/kibana/tests/kibana_test.py @@ -41,6 +41,9 @@ def test_defaults(): assert r['deployment'][name]['spec']['strategy']['type'] == 'Recreate' + # Make sure that the default 'annotation' dictionary is empty + assert 'annotations' not in r['service'][name]['metadata'] + def test_overriding_the_elasticsearch_hosts(): config = ''' elasticsearchHosts: 'http://hello.world' @@ -252,3 +255,23 @@ def test_priority_class_name(): r = helm_template(config) priority_class_name = r['deployment'][name]['spec']['template']['spec']['priorityClassName'] assert priority_class_name == "highest" + + +def test_service_annotatations(): + config = ''' +service: + annotations: + cloud.google.com/load-balancer-type: "Internal" + ''' + r = helm_template(config) + s = r['service'][name]['metadata']['annotations']['cloud.google.com/load-balancer-type'] + assert s == "Internal" + + config = ''' +service: + annotations: + service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0 + ''' + r = helm_template(config) + s = r['service'][name]['metadata']['annotations']['service.beta.kubernetes.io/aws-load-balancer-internal'] + assert s == "0.0.0.0/0" \ No newline at end of file diff --git a/kibana/values.yaml b/kibana/values.yaml index 297e9df32..d3a212f57 100755 --- a/kibana/values.yaml +++ b/kibana/values.yaml @@ -74,6 +74,12 @@ updateStrategy: service: type: ClusterIP port: 5601 + annotations: {} + # cloud.google.com/load-balancer-type: "Internal" + # service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0 + # service.beta.kubernetes.io/azure-load-balancer-internal: "true" + # service.beta.kubernetes.io/openstack-internal-load-balancer: "true" + # service.beta.kubernetes.io/cce-load-balancer-internal-vpc: "true" ingress: enabled: false