From c1824531cde3ebf40b775f5bcbf4ddcb9736df49 Mon Sep 17 00:00:00 2001 From: juanjocop Date: Mon, 26 Feb 2024 01:00:39 +0100 Subject: [PATCH 1/4] Adding nodeSelector option to execute only in nodes you need --- charts/docker-mailserver/templates/deployment.yaml | 1 + charts/docker-mailserver/values.yaml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/charts/docker-mailserver/templates/deployment.yaml b/charts/docker-mailserver/templates/deployment.yaml index ec096deb..0248b696 100644 --- a/charts/docker-mailserver/templates/deployment.yaml +++ b/charts/docker-mailserver/templates/deployment.yaml @@ -29,6 +29,7 @@ spec: {{ toYaml .Values.deployment.annotations | indent 8 }} {{ end }} spec: + nodeSelector: {{- toYaml .Values.deployment.nodeSelector | nindent 8 }} runtimeClassName: {{ .Values.deployment.runtimeClassName }} priorityClassName: {{ .Values.deployment.priorityClassName }} serviceAccountName: {{ template "dockermailserver.serviceAccountName" . }} diff --git a/charts/docker-mailserver/values.yaml b/charts/docker-mailserver/values.yaml index 9f3f94de..7870c167 100644 --- a/charts/docker-mailserver/values.yaml +++ b/charts/docker-mailserver/values.yaml @@ -34,6 +34,9 @@ deployment: ## Optionally specify a priorityClassName for the deployment priorityClassName: + ## Optionally specify a nodeSelector for the deployment + nodeSelector: {} + ## Use the host’s network namespace. If this option is set, the ports that ## will be used must be specified. ## Ref: https://kubernetes.io/docs/api-reference/v1/definitions/#_v1_podspec From 61f96ae5bfd7fb0eda0e255b71752b21980fbe92 Mon Sep 17 00:00:00 2001 From: juanjocop Date: Mon, 26 Feb 2024 01:13:23 +0100 Subject: [PATCH 2/4] Adding the option to add labels in load balancer service --- charts/docker-mailserver/templates/service.yaml | 3 +++ charts/docker-mailserver/values.yaml | 1 + 2 files changed, 4 insertions(+) diff --git a/charts/docker-mailserver/templates/service.yaml b/charts/docker-mailserver/templates/service.yaml index 2298d429..4504d7f5 100644 --- a/charts/docker-mailserver/templates/service.yaml +++ b/charts/docker-mailserver/templates/service.yaml @@ -19,6 +19,9 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" heritage: "{{ .Release.Service }}" release: "{{ .Release.Name }}" + {{- with .Values.service.labels }} + {{ toYaml . | nindent 2 }} + {{- end }} name: {{ template "dockermailserver.fullname" . }} spec: ## If a load balancer is being used, ensure that the newer type of LB that passes along IP information is used diff --git a/charts/docker-mailserver/values.yaml b/charts/docker-mailserver/values.yaml index 7870c167..7c2b17a8 100644 --- a/charts/docker-mailserver/values.yaml +++ b/charts/docker-mailserver/values.yaml @@ -286,6 +286,7 @@ service: ## If there is a Hostname associated with this site, add it here and it will be rendered in the documentation. # hostName: annotations: {} + labels: {} # Note this is a dictionary and not a list so invidual keys can be overriden by --set or --value helm parameters persistence: From 1d218fb5d4edb3d44126d2cb95e5fb6e6a301efc Mon Sep 17 00:00:00 2001 From: juanjocop Date: Mon, 26 Feb 2024 10:38:10 +0100 Subject: [PATCH 3/4] updating 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 26018e1e..497f2f41 100644 --- a/charts/docker-mailserver/Chart.yaml +++ b/charts/docker-mailserver/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: "13.3.1" description: A fullstack but simple mailserver (smtp, imap, antispam, antivirus, ssl...) using Docker. name: docker-mailserver -version: 3.0.3 +version: 3.0.4 sources: - https://github.com/docker-mailserver/docker-mailserver-helm maintainers: From a34fbe0c261b880b9fb0ca75f3699e5193fcb788 Mon Sep 17 00:00:00 2001 From: juanjocop Date: Mon, 26 Feb 2024 11:08:01 +0100 Subject: [PATCH 4/4] fixing after testing, now it's works --- charts/docker-mailserver/templates/service.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/docker-mailserver/templates/service.yaml b/charts/docker-mailserver/templates/service.yaml index 4504d7f5..b83d5227 100644 --- a/charts/docker-mailserver/templates/service.yaml +++ b/charts/docker-mailserver/templates/service.yaml @@ -19,9 +19,9 @@ metadata: chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" heritage: "{{ .Release.Service }}" release: "{{ .Release.Name }}" - {{- with .Values.service.labels }} - {{ toYaml . | nindent 2 }} - {{- end }} + {{- if .Values.service.labels }} + {{ toYaml .Values.service.labels | indent 2 }} + {{ end }} name: {{ template "dockermailserver.fullname" . }} spec: ## If a load balancer is being used, ensure that the newer type of LB that passes along IP information is used