Skip to content
This repository was archived by the owner on May 16, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions logstash/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ metadata:
{{ toYaml .Values.service.annotations | indent 4 }}
spec:
type: {{ .Values.service.type }}
{{- if .Values.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end }}
{{- with .Values.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml . | indent 4 }}
{{- end }}
selector:
app: "{{ template "logstash.fullname" . }}"
chart: "{{ .Chart.Name }}"
Expand Down
13 changes: 13 additions & 0 deletions logstash/tests/logstash_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -862,6 +862,8 @@ def test_adding_a_service():
"protocol": "TCP",
"targetPort": 5044,
}
# Make sure that the default 'loadBalancerIP' string is empty
assert "loadBalancerIP" not in s["spec"]


def test_setting_fullnameOverride():
Expand Down Expand Up @@ -916,3 +918,14 @@ def test_hostaliases():
r = helm_template(config)
hostAliases = r["statefulset"][name]["spec"]["template"]["spec"]["hostAliases"]
assert {"ip": "127.0.0.1", "hostnames": ["foo.local", "bar.local"]} in hostAliases


def test_adding_loadBalancerIP():
config = """
service:
loadBalancerIP: 12.5.11.79
"""

r = helm_template(config)

assert r["service"][name]["spec"]["loadBalancerIP"] == "12.5.11.79"
1 change: 1 addition & 0 deletions logstash/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ lifecycle: {}
service: {}
# annotations: {}
# type: ClusterIP
# loadBalancerIP: ""
# ports:
# - name: beats
# port: 5044
Expand Down