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

Commit

Permalink
[logstash] Add option loadBalancerIP to service (#1099)
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Mailleret <[email protected]>
  • Loading branch information
ebuildy and jmlrt authored Mar 17, 2021
1 parent 4524945 commit fa7bdd8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
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 @@ -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,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 @@ -253,6 +253,7 @@ lifecycle: {}
service: {}
# annotations: {}
# type: ClusterIP
# loadBalancerIP: ""
# ports:
# - name: beats
# port: 5044
Expand Down

0 comments on commit fa7bdd8

Please sign in to comment.