Skip to content

Commit

Permalink
Merge pull request #145 from furstblumier/feature/externaltraffic-toggle
Browse files Browse the repository at this point in the history
Thanks for the reminder, forgot I hadn't merge this.
  • Loading branch information
cfis authored Feb 13, 2025
2 parents a475362 + f529989 commit 33a268f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/docker-mailserver/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: "14.0.0"
description: A fullstack but simple mailserver (smtp, imap, antispam, antivirus, ssl...) using Docker.
name: docker-mailserver
version: 4.1.3
version: 4.1.4
sources:
- https://github.com/docker-mailserver/docker-mailserver-helm
maintainers:
Expand Down
2 changes: 1 addition & 1 deletion charts/docker-mailserver/ci/ci-haproxy.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
service:
type: ClusterIP
type: ClusterIP
12 changes: 9 additions & 3 deletions charts/docker-mailserver/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,17 @@ metadata:
spec:
## If a load balancer is being used, ensure that the newer type of LB that passes along IP information is used
## rather than the legacy one.
{{- if eq .Values.service.type "LoadBalancer" }}
{{- if or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer") }}
{{- if .Values.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
{{- end }}
{{- if and (not .Values.service.externalTrafficPolicy) (eq .Values.service.type "LoadBalancer") }}
externalTrafficPolicy: Local
{{- else if eq .Values.service.type "NodePort" }}
{{- end }}
{{- if and (not .Values.service.externalTrafficPolicy) (eq .Values.service.type "NodePort") }}
externalTrafficPolicy: Cluster
{{ end }}
{{- end }}
{{- end }}
selector:
app.kubernetes.io/name: {{ template "dockermailserver.fullname" . }}
release: "{{ .Release.Name }}"
Expand Down
9 changes: 8 additions & 1 deletion charts/docker-mailserver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,15 @@ deployment:
service:
## What scope the service should be exposed in. One of:
## - LoadBalancer (to the world)
## - NodePort (to the world, via high port on a node)
## - ClusterIP (to the cluster)
type: "LoadBalancer"
type: "ClusterIP"
## Manually overwrite the externalTrafficPolicy. One of:
## - Local
## - Cluster
## Set it to "Local" when used with type "LoadBalancer" and set it to "Cluster" when used with "NodePort",
## unless you have a good reason not to.
# externalTrafficPolicy: "Cluster"
## If there is a port associated with a given service, expose it here.
# port:
## If there is a particular IP that should be used for the service, specify it here.
Expand Down

0 comments on commit 33a268f

Please sign in to comment.