diff --git a/charts/docker-mailserver/Chart.yaml b/charts/docker-mailserver/Chart.yaml index cdfbb767..5a47cea6 100644 --- a/charts/docker-mailserver/Chart.yaml +++ b/charts/docker-mailserver/Chart.yaml @@ -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: diff --git a/charts/docker-mailserver/ci/ci-haproxy.yaml b/charts/docker-mailserver/ci/ci-haproxy.yaml index 3f0a1bdb..b738e2a5 100644 --- a/charts/docker-mailserver/ci/ci-haproxy.yaml +++ b/charts/docker-mailserver/ci/ci-haproxy.yaml @@ -1,2 +1,2 @@ service: - type: ClusterIP \ No newline at end of file + type: ClusterIP diff --git a/charts/docker-mailserver/templates/service.yaml b/charts/docker-mailserver/templates/service.yaml index 874fdd45..79971719 100644 --- a/charts/docker-mailserver/templates/service.yaml +++ b/charts/docker-mailserver/templates/service.yaml @@ -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 }}" diff --git a/charts/docker-mailserver/values.yaml b/charts/docker-mailserver/values.yaml index 0367c318..a2ea32c8 100644 --- a/charts/docker-mailserver/values.yaml +++ b/charts/docker-mailserver/values.yaml @@ -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.