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

[7.x][logstash] Add option loadBalancerIP to service (#1099) #1175

Merged
merged 2 commits into from
May 10, 2021
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
12 changes: 12 additions & 0 deletions logstash/tests/logstash_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,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 @@ -935,3 +937,13 @@ 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

jmlrt marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -253,6 +253,7 @@ lifecycle: {}
service: {}
# annotations: {}
# type: ClusterIP
# loadBalancerIP: ""
# ports:
# - name: beats
# port: 5044
Expand Down