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

[logstash] add externalTrafficPolicy support #1570

Merged
merged 3 commits into from
Mar 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
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
15 changes: 9 additions & 6 deletions logstash/values.yaml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ secrets: []
# cert.crt: "LS0tLS1CRUdJTiBlRJRklDQVRFLS0tLS0K"
# cert.key.filepath: "secrets.crt" # The path to file should be relative to the `values.yaml` file.


# A list of secrets and their paths to mount inside the pod
secretMounts: []

Expand Down Expand Up @@ -92,7 +91,7 @@ resources:
memory: "1536Mi"

volumeClaimTemplate:
accessModes: [ "ReadWriteOnce" ]
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 1Gi
Expand All @@ -101,7 +100,8 @@ rbac:
create: false
serviceAccountAnnotations: {}
serviceAccountName: ""
annotations: {}
annotations:
{}
#annotation1: "value1"
#annotation2: "value2"
#annotation3: "value3"
Expand Down Expand Up @@ -174,7 +174,8 @@ podManagementPolicy: "Parallel"
httpPort: 9600

# Custom ports to add to logstash
extraPorts: []
extraPorts:
[]
# - name: beats
# containerPort: 5001

Expand All @@ -192,7 +193,7 @@ podSecurityContext:
securityContext:
capabilities:
drop:
- ALL
- ALL
# readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
Expand Down Expand Up @@ -246,7 +247,8 @@ tolerations: []
nameOverride: ""
fullnameOverride: ""

lifecycle: {}
lifecycle:
{}
# preStop:
# exec:
# command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"]
Expand All @@ -258,6 +260,7 @@ service: {}
# annotations: {}
# type: ClusterIP
# loadBalancerIP: ""
# externalTrafficPolicy: ""
# ports:
# - name: beats
# port: 5044
Expand Down