From 613b143f83c28796c4fe10aaf0c3809325b9003e Mon Sep 17 00:00:00 2001 From: johnstarx Date: Sat, 29 Jun 2024 13:39:59 +0000 Subject: [PATCH 1/3] Added initContainers --- charts/docker-mailserver/Chart.yaml | 2 +- .../templates/deployment.yaml | 28 +++++++++++++++++++ charts/docker-mailserver/values.yaml | 18 ++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/charts/docker-mailserver/Chart.yaml b/charts/docker-mailserver/Chart.yaml index 05c9ba0a..d8190d36 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.0.0 +version: 4.0.2 sources: - https://github.com/docker-mailserver/docker-mailserver-helm maintainers: diff --git a/charts/docker-mailserver/templates/deployment.yaml b/charts/docker-mailserver/templates/deployment.yaml index b20d6f36..b706749e 100644 --- a/charts/docker-mailserver/templates/deployment.yaml +++ b/charts/docker-mailserver/templates/deployment.yaml @@ -80,6 +80,29 @@ spec: {{- end }} {{- end }} + # Extra volumes + {{- with .Values.deployment.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} + + {{- with .Values.deployment.initContainers }} + initContainers: + {{- range . }} + - name: {{ .name }} + image: {{ .image }} + {{- with .command }} + command: {{ toYaml . | nindent 10 }} + {{- end }} + {{- with .args }} + args: {{ toYaml . | nindent 10 }} + {{- end }} + {{- with $.Values.deployment.extraVolumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- end }} + {{- end }} + containers: - name: docker-mailserver image: {{ .Values.image.name }}:{{ default .Chart.AppVersion .Values.image.tag }} @@ -147,6 +170,11 @@ spec: {{- end }} {{- end }} + # Mount Extra Volumes + {{- with $.Values.deployment.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} + livenessProbe: exec: command: diff --git a/charts/docker-mailserver/values.yaml b/charts/docker-mailserver/values.yaml index 128931be..d26ac0b8 100644 --- a/charts/docker-mailserver/values.yaml +++ b/charts/docker-mailserver/values.yaml @@ -272,6 +272,24 @@ deployment: ## Optionally specify tolerations for the deployment tolerations: [] + ## Optionally specify initContainers + initContainers: [] + # - name: init + # image: alpine:3 + # command: [sh, -c] + # args: + # - echo "Hello, world!" > /mnt/extra-storage/test + + ## Optionally specify a list of extra mounts to add (normally used with extraVolumes) + extraVolumeMounts: [] + # - name: extra-storage + # mountPath: /mnt/extra-storage + + ## Optionally specify a list of extra volumes to add + extraVolumes: [] + # - name: extra-storage + # emptyDir: {} + service: ## What scope the service should be exposed in. One of: ## - LoadBalancer (to the world) From 244a6fbc7b77727449f7e414864bc5c200f2a067 Mon Sep 17 00:00:00 2001 From: johnstarx Date: Tue, 2 Jul 2024 08:27:38 +0000 Subject: [PATCH 2/3] 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 d8190d36..444c0a07 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.0.2 +version: 4.0.3 sources: - https://github.com/docker-mailserver/docker-mailserver-helm maintainers: From 410ab894e465b665e044f37b7692e908bc2796bc Mon Sep 17 00:00:00 2001 From: johnstarx Date: Sat, 6 Jul 2024 19:08:49 +0000 Subject: [PATCH 3/3] Allow users to choose which volumeMounts the initContainers have --- .../templates/deployment.yaml | 19 ++++--------------- charts/docker-mailserver/values.yaml | 3 +++ 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/charts/docker-mailserver/templates/deployment.yaml b/charts/docker-mailserver/templates/deployment.yaml index b706749e..0096a74b 100644 --- a/charts/docker-mailserver/templates/deployment.yaml +++ b/charts/docker-mailserver/templates/deployment.yaml @@ -85,22 +85,11 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.deployment.initContainers }} + {{- if .Values.deployment.initContainers }} initContainers: - {{- range . }} - - name: {{ .name }} - image: {{ .image }} - {{- with .command }} - command: {{ toYaml . | nindent 10 }} - {{- end }} - {{- with .args }} - args: {{ toYaml . | nindent 10 }} - {{- end }} - {{- with $.Values.deployment.extraVolumeMounts }} - volumeMounts: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- end }} + {{- with .Values.deployment.initContainers }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} containers: diff --git a/charts/docker-mailserver/values.yaml b/charts/docker-mailserver/values.yaml index d26ac0b8..77a1b57d 100644 --- a/charts/docker-mailserver/values.yaml +++ b/charts/docker-mailserver/values.yaml @@ -279,6 +279,9 @@ deployment: # command: [sh, -c] # args: # - echo "Hello, world!" > /mnt/extra-storage/test + # volumeMounts: + # - name: extra-storage + # mountPath: /mnt/extra-storage ## Optionally specify a list of extra mounts to add (normally used with extraVolumes) extraVolumeMounts: []