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

Commit

Permalink
Merge pull request #151 from natebwangsut/master
Browse files Browse the repository at this point in the history
[Kibana] Update kibana service template
  • Loading branch information
Crazybus authored Jun 7, 2019
2 parents 4918ca7 + 920417c commit 240ee9e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
1 change: 1 addition & 0 deletions kibana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`<br>`port: 5601`<br>`annotations: {}` |

## Examples

Expand Down
4 changes: 4 additions & 0 deletions kibana/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
23 changes: 23 additions & 0 deletions kibana/tests/kibana_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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"
6 changes: 6 additions & 0 deletions kibana/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 240ee9e

Please sign in to comment.