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

Commit

Permalink
[logstash] add externalTrafficPolicy support (elastic#1570)
Browse files Browse the repository at this point in the history
* [logstash] add externalTrafficPolicy support

Fix elastic#1548

* fixup! [logstash] add externalTrafficPolicy support
  • Loading branch information
jmlrt committed Mar 2, 2022
1 parent 5a1d6a4 commit d0f2264
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions logstash/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ spec:
{{- with .Values.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml . | indent 4 }}
{{- end }}
{{- if .Values.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
{{- end }}
selector:
app: "{{ template "logstash.fullname" . }}"
Expand Down
11 changes: 11 additions & 0 deletions logstash/tests/logstash_test.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,17 @@ def test_adding_a_service():
assert "loadBalancerIP" not in s["spec"]


def test_adding_an_externalTrafficPolicy():
config = """
service:
externalTrafficPolicy: Local
"""

r = helm_template(config)

assert r["service"][name]["spec"]["externalTrafficPolicy"] == "Local"


def test_setting_fullnameOverride():
config = """
fullnameOverride: 'logstash-custom'
Expand Down
1 change: 1 addition & 0 deletions logstash/values.yaml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ service: {}
# annotations: {}
# type: ClusterIP
# loadBalancerIP: ""
# externalTrafficPolicy: ""
# ports:
# - name: beats
# port: 5044
Expand Down

0 comments on commit d0f2264

Please sign in to comment.