Skip to content

Commit f529989

Browse files
committed
use the old logic again
1 parent 000ed76 commit f529989

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

charts/docker-mailserver/templates/service.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,17 @@ metadata:
2626
spec:
2727
## If a load balancer is being used, ensure that the newer type of LB that passes along IP information is used
2828
## rather than the legacy one.
29+
{{- if or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer") }}
2930
{{- if .Values.service.externalTrafficPolicy }}
3031
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
3132
{{- end }}
33+
{{- if and (not .Values.service.externalTrafficPolicy) (eq .Values.service.type "LoadBalancer") }}
34+
externalTrafficPolicy: Local
35+
{{- end }}
36+
{{- if and (not .Values.service.externalTrafficPolicy) (eq .Values.service.type "NodePort") }}
37+
externalTrafficPolicy: Cluster
38+
{{- end }}
39+
{{- end }}
3240
selector:
3341
app.kubernetes.io/name: {{ template "dockermailserver.fullname" . }}
3442
release: "{{ .Release.Name }}"

0 commit comments

Comments
 (0)