From 48072ae3331e66d07a7164a89bbe26e45a153bd5 Mon Sep 17 00:00:00 2001 From: furstblumier <7149167+furstblumier@users.noreply.github.com> Date: Mon, 3 Feb 2025 17:45:50 +0100 Subject: [PATCH 01/11] add externalTrafficPolicy toggle --- charts/docker-mailserver/templates/service.yaml | 6 +----- charts/docker-mailserver/values.yaml | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/charts/docker-mailserver/templates/service.yaml b/charts/docker-mailserver/templates/service.yaml index 874fdd45..87613765 100644 --- a/charts/docker-mailserver/templates/service.yaml +++ b/charts/docker-mailserver/templates/service.yaml @@ -26,11 +26,7 @@ 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" }} - externalTrafficPolicy: Local - {{- else if eq .Values.service.type "NodePort" }} - externalTrafficPolicy: Cluster - {{ end }} + externalTrafficPolicy: {{ default "Local" .Values.service.externalTrafficPolicy }} 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 4adc26d0..7d0e797a 100644 --- a/charts/docker-mailserver/values.yaml +++ b/charts/docker-mailserver/values.yaml @@ -298,6 +298,11 @@ service: ## - LoadBalancer (to the world) ## - ClusterIP (to the cluster) type: "LoadBalancer" + ## Manually overwrite the externalTrafficPolicy. One of: + ## - Local + ## - Cluster + ## Set it to "Local" when used with type "LoadBalancer", unless you have a good reason not to. + # externalTrafficPolicy: Local ## 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. From 143fefaf1a156bf48922682c3f076fa0f0eb6332 Mon Sep 17 00:00:00 2001 From: furstblumier <7149167+furstblumier@users.noreply.github.com> Date: Mon, 3 Feb 2025 17:58:57 +0100 Subject: [PATCH 02/11] bump chart version --- charts/docker-mailserver/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/docker-mailserver/Chart.yaml b/charts/docker-mailserver/Chart.yaml index 0fb6edd0..ce225b6d 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.1 +version: 4.1.2 sources: - https://github.com/docker-mailserver/docker-mailserver-helm maintainers: From 367cf689e29d3519f621942f858faef691e3841c Mon Sep 17 00:00:00 2001 From: furstblumier <7149167+furstblumier@users.noreply.github.com> Date: Mon, 3 Feb 2025 20:49:13 +0100 Subject: [PATCH 03/11] Bump version and also change the toggle based on feedback --- charts/docker-mailserver/Chart.yaml | 2 +- charts/docker-mailserver/templates/service.yaml | 2 +- charts/docker-mailserver/values.yaml | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/charts/docker-mailserver/Chart.yaml b/charts/docker-mailserver/Chart.yaml index ce225b6d..cdfbb767 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.2 +version: 4.1.3 sources: - https://github.com/docker-mailserver/docker-mailserver-helm maintainers: diff --git a/charts/docker-mailserver/templates/service.yaml b/charts/docker-mailserver/templates/service.yaml index 87613765..3dfdfeac 100644 --- a/charts/docker-mailserver/templates/service.yaml +++ b/charts/docker-mailserver/templates/service.yaml @@ -26,7 +26,7 @@ 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. - externalTrafficPolicy: {{ default "Local" .Values.service.externalTrafficPolicy }} + externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }} 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 7d0e797a..affb3692 100644 --- a/charts/docker-mailserver/values.yaml +++ b/charts/docker-mailserver/values.yaml @@ -301,8 +301,9 @@ service: ## Manually overwrite the externalTrafficPolicy. One of: ## - Local ## - Cluster - ## Set it to "Local" when used with type "LoadBalancer", unless you have a good reason not to. - # externalTrafficPolicy: Local + ## Set it to "Local" when used with type "LoadBalancer" and set it to "Cluster" when used with type "ClusterIP", + ## unless you have a good reason not to. + externalTrafficPolicy: "Local" ## 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. From 65ce085a460523c72e52a0d7f0dcc663dad118c5 Mon Sep 17 00:00:00 2001 From: Frank W Date: Sun, 2 Feb 2025 22:32:46 +0100 Subject: [PATCH 04/11] Update line numbers in links in README.md --- charts/docker-mailserver/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/docker-mailserver/README.md b/charts/docker-mailserver/README.md index 19565d4b..23dfd890 100644 --- a/charts/docker-mailserver/README.md +++ b/charts/docker-mailserver/README.md @@ -98,11 +98,11 @@ Configuration files are stored on a Kubernetes [volume](#persistence) mounted at ### ConfigMaps -Its is also possible to use ConfigMaps to mount configuration files in the container. This is done by adding to the `configFiles` key in a custom `values.yaml` file. For more information please see the [documentation](./values.yaml#L425) in values.yaml +Its is also possible to use ConfigMaps to mount configuration files in the container. This is done by adding to the `configFiles` key in a custom `values.yaml` file. For more information please see the [documentation](./values.yaml#L453) in values.yaml ### Secrets -Secrets can also be used to mount configuration files in the container. For example, dkim keys could be stored in a secret as opposed to a file in the `mail-config` volume. Once again, for more information please see the [documentation](./values.yaml#L600) in values.yaml +Secrets can also be used to mount configuration files in the container. For example, dkim keys could be stored in a secret as opposed to a file in the `mail-config` volume. Once again, for more information please see the [documentation](./values.yaml#L610) in values.yaml ## Values YAML From 814cb9721a15fd3d8fb33ae84c096e78b0136c51 Mon Sep 17 00:00:00 2001 From: Frank W Date: Mon, 3 Feb 2025 11:54:44 +0100 Subject: [PATCH 05/11] Chart version bump --- charts/docker-mailserver/Chart.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/docker-mailserver/Chart.yaml b/charts/docker-mailserver/Chart.yaml index cdfbb767..37080814 100644 --- a/charts/docker-mailserver/Chart.yaml +++ b/charts/docker-mailserver/Chart.yaml @@ -2,7 +2,11 @@ apiVersion: v2 appVersion: "14.0.0" description: A fullstack but simple mailserver (smtp, imap, antispam, antivirus, ssl...) using Docker. name: docker-mailserver +<<<<<<< HEAD version: 4.1.3 +======= +version: 4.1.2 +>>>>>>> 42f02f0 (Chart version bump) sources: - https://github.com/docker-mailserver/docker-mailserver-helm maintainers: From 37311c6c87aacd22d611f9539fc8e3c4a00a459d Mon Sep 17 00:00:00 2001 From: furstblumier <7149167+furstblumier@users.noreply.github.com> Date: Tue, 4 Feb 2025 21:13:35 +0100 Subject: [PATCH 06/11] Document it a bit more clear --- charts/docker-mailserver/values.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/docker-mailserver/values.yaml b/charts/docker-mailserver/values.yaml index affb3692..4c0e47b8 100644 --- a/charts/docker-mailserver/values.yaml +++ b/charts/docker-mailserver/values.yaml @@ -296,12 +296,13 @@ 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" ## 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 type "ClusterIP", + ## Set it to "Local" when used with type "LoadBalancer" and set it to "Cluster" when used with type "ClusterIP" or "NodePort", ## unless you have a good reason not to. externalTrafficPolicy: "Local" ## If there is a port associated with a given service, expose it here. From 3352ce96419e3c22f4772bc975882c5a0fe43146 Mon Sep 17 00:00:00 2001 From: furstblumier <7149167+furstblumier@users.noreply.github.com> Date: Wed, 5 Feb 2025 09:13:21 +0100 Subject: [PATCH 07/11] fix ci tests and new default value --- charts/docker-mailserver/ci/ci-values.yaml | 1 + charts/docker-mailserver/values.yaml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/charts/docker-mailserver/ci/ci-values.yaml b/charts/docker-mailserver/ci/ci-values.yaml index c40d0a96..73a942f1 100644 --- a/charts/docker-mailserver/ci/ci-values.yaml +++ b/charts/docker-mailserver/ci/ci-values.yaml @@ -1,5 +1,6 @@ service: type: ClusterIP + externalTrafficPolicy: Local configMaps: postfix-accounts.cf: diff --git a/charts/docker-mailserver/values.yaml b/charts/docker-mailserver/values.yaml index 4c0e47b8..6d835546 100644 --- a/charts/docker-mailserver/values.yaml +++ b/charts/docker-mailserver/values.yaml @@ -298,13 +298,13 @@ service: ## - 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 type "ClusterIP" or "NodePort", ## unless you have a good reason not to. - externalTrafficPolicy: "Local" + 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. From daca24be5501af8b33e8ba3592918c247a7fea90 Mon Sep 17 00:00:00 2001 From: furstblumier <7149167+furstblumier@users.noreply.github.com> Date: Wed, 5 Feb 2025 10:18:33 +0100 Subject: [PATCH 08/11] fix CI for real --- charts/docker-mailserver/ci/ci-values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/docker-mailserver/ci/ci-values.yaml b/charts/docker-mailserver/ci/ci-values.yaml index 73a942f1..28aa6a53 100644 --- a/charts/docker-mailserver/ci/ci-values.yaml +++ b/charts/docker-mailserver/ci/ci-values.yaml @@ -1,6 +1,6 @@ service: type: ClusterIP - externalTrafficPolicy: Local + externalTrafficPolicy: Cluster configMaps: postfix-accounts.cf: From e63f80f4aa62baf03bc59b2bc9f1005b594ff70c Mon Sep 17 00:00:00 2001 From: furstblumier <7149167+furstblumier@users.noreply.github.com> Date: Fri, 7 Feb 2025 08:19:37 +0100 Subject: [PATCH 09/11] bump chart + another round of CI --- charts/docker-mailserver/Chart.yaml | 2 +- charts/docker-mailserver/ci/ci-values.yaml | 2 +- charts/docker-mailserver/values.yaml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) 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-values.yaml b/charts/docker-mailserver/ci/ci-values.yaml index 28aa6a53..73a942f1 100644 --- a/charts/docker-mailserver/ci/ci-values.yaml +++ b/charts/docker-mailserver/ci/ci-values.yaml @@ -1,6 +1,6 @@ service: type: ClusterIP - externalTrafficPolicy: Cluster + externalTrafficPolicy: Local configMaps: postfix-accounts.cf: diff --git a/charts/docker-mailserver/values.yaml b/charts/docker-mailserver/values.yaml index 6d835546..0555440b 100644 --- a/charts/docker-mailserver/values.yaml +++ b/charts/docker-mailserver/values.yaml @@ -302,9 +302,9 @@ service: ## 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 type "ClusterIP" or "NodePort", + ## Set it to "Local" when used with type "LoadBalancer" or "ClusterIP" and set it to "Cluster" when used with "NodePort", ## unless you have a good reason not to. - externalTrafficPolicy: "Cluster" + externalTrafficPolicy: "Local" ## 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. From 000ed765d9f408e56e5c7250747b52dc4ac3e780 Mon Sep 17 00:00:00 2001 From: furstblumier <7149167+furstblumier@users.noreply.github.com> Date: Fri, 7 Feb 2025 14:29:47 +0100 Subject: [PATCH 10/11] fix externalTrafficPolicy --- charts/docker-mailserver/ci/ci-haproxy.yaml | 2 +- charts/docker-mailserver/ci/ci-values.yaml | 1 - charts/docker-mailserver/templates/service.yaml | 2 ++ charts/docker-mailserver/values.yaml | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) 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/ci/ci-values.yaml b/charts/docker-mailserver/ci/ci-values.yaml index 73a942f1..c40d0a96 100644 --- a/charts/docker-mailserver/ci/ci-values.yaml +++ b/charts/docker-mailserver/ci/ci-values.yaml @@ -1,6 +1,5 @@ service: type: ClusterIP - externalTrafficPolicy: Local configMaps: postfix-accounts.cf: diff --git a/charts/docker-mailserver/templates/service.yaml b/charts/docker-mailserver/templates/service.yaml index 3dfdfeac..2c893cdf 100644 --- a/charts/docker-mailserver/templates/service.yaml +++ b/charts/docker-mailserver/templates/service.yaml @@ -26,7 +26,9 @@ 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 .Values.service.externalTrafficPolicy }} externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }} + {{- 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 92226dd3..a2ea32c8 100644 --- a/charts/docker-mailserver/values.yaml +++ b/charts/docker-mailserver/values.yaml @@ -304,9 +304,9 @@ service: ## Manually overwrite the externalTrafficPolicy. One of: ## - Local ## - Cluster - ## Set it to "Local" when used with type "LoadBalancer" or "ClusterIP" and set it to "Cluster" when used with "NodePort", + ## 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: "Local" + # 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. From f52998973f24429889402286833fa6724293bac9 Mon Sep 17 00:00:00 2001 From: furstblumier <7149167+furstblumier@users.noreply.github.com> Date: Fri, 7 Feb 2025 14:53:29 +0100 Subject: [PATCH 11/11] use the old logic again --- charts/docker-mailserver/templates/service.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/charts/docker-mailserver/templates/service.yaml b/charts/docker-mailserver/templates/service.yaml index 2c893cdf..79971719 100644 --- a/charts/docker-mailserver/templates/service.yaml +++ b/charts/docker-mailserver/templates/service.yaml @@ -26,9 +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 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 + {{- end }} + {{- if and (not .Values.service.externalTrafficPolicy) (eq .Values.service.type "NodePort") }} + externalTrafficPolicy: Cluster + {{- end }} + {{- end }} selector: app.kubernetes.io/name: {{ template "dockermailserver.fullname" . }} release: "{{ .Release.Name }}"