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

Commit 240ee9e

Browse files
authored
Merge pull request #151 from natebwangsut/master
[Kibana] Update kibana service template
2 parents 4918ca7 + 920417c commit 240ee9e

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

kibana/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ helm install --name kibana elastic/kibana --version 7.1.1 --set imageTag=7.1.1
6565
| `nodeSelector` | Configurable [nodeSelector](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector) so that you can target specific nodes for your Kibana instances | `{}` |
6666
| `tolerations` | Configurable [tolerations](https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/) | `[]` |
6767
| `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` |
68+
| `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>`annotations: {}` |
6869

6970
## Examples
7071

kibana/templates/service.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ metadata:
77
app: {{ .Chart.Name }}
88
release: {{ .Release.Name | quote }}
99
heritage: {{ .Release.Service }}
10+
{{- with .Values.service.annotations }}
11+
annotations:
12+
{{ toYaml . | indent 4 }}
13+
{{- end }}
1014
spec:
1115
type: {{ .Values.service.type }}
1216
ports:

kibana/tests/kibana_test.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ def test_defaults():
4141

4242
assert r['deployment'][name]['spec']['strategy']['type'] == 'Recreate'
4343

44+
# Make sure that the default 'annotation' dictionary is empty
45+
assert 'annotations' not in r['service'][name]['metadata']
46+
4447
def test_overriding_the_elasticsearch_hosts():
4548
config = '''
4649
elasticsearchHosts: 'http://hello.world'
@@ -252,3 +255,23 @@ def test_priority_class_name():
252255
r = helm_template(config)
253256
priority_class_name = r['deployment'][name]['spec']['template']['spec']['priorityClassName']
254257
assert priority_class_name == "highest"
258+
259+
260+
def test_service_annotatations():
261+
config = '''
262+
service:
263+
annotations:
264+
cloud.google.com/load-balancer-type: "Internal"
265+
'''
266+
r = helm_template(config)
267+
s = r['service'][name]['metadata']['annotations']['cloud.google.com/load-balancer-type']
268+
assert s == "Internal"
269+
270+
config = '''
271+
service:
272+
annotations:
273+
service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
274+
'''
275+
r = helm_template(config)
276+
s = r['service'][name]['metadata']['annotations']['service.beta.kubernetes.io/aws-load-balancer-internal']
277+
assert s == "0.0.0.0/0"

kibana/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ updateStrategy:
7474
service:
7575
type: ClusterIP
7676
port: 5601
77+
annotations: {}
78+
# cloud.google.com/load-balancer-type: "Internal"
79+
# service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
80+
# service.beta.kubernetes.io/azure-load-balancer-internal: "true"
81+
# service.beta.kubernetes.io/openstack-internal-load-balancer: "true"
82+
# service.beta.kubernetes.io/cce-load-balancer-internal-vpc: "true"
7783

7884
ingress:
7985
enabled: false

0 commit comments

Comments
 (0)