Skip to content

Commit 8564aa3

Browse files
committed
Acknowledge the reality of securityContext handling
1 parent f641031 commit 8564aa3

5 files changed

Lines changed: 20 additions & 22 deletions

File tree

charts/docker-mailserver/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
appVersion: "15.1.0"
33
description: A fullstack but simple mailserver (smtp, imap, antispam, antivirus, ssl...) using Docker.
44
name: docker-mailserver
5-
version: 5.1.1
5+
version: 5.1.2
66
sources:
77
- https://github.com/docker-mailserver/docker-mailserver-helm
88
maintainers:

charts/docker-mailserver/templates/deployment.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ spec:
4444
restartPolicy: "Always"
4545
serviceAccountName: {{ template "dockermailserver.serviceAccountName" . }}
4646
securityContext:
47-
{{ toYaml .Values.securityContext | indent 8 }}
47+
{{ toYaml (coalesce .Values.deployment.securityContext .Values.securityContext) | indent 8 }}
4848
{{- if .Values.deployment.tolerations }}
4949
tolerations: {{- toYaml .Values.deployment.tolerations | nindent 8 }}
5050
{{ end }}
@@ -217,7 +217,7 @@ spec:
217217
containerPort: 10465
218218
- name: sub-proxy
219219
containerPort: 10587
220-
{{- end }}
220+
{{- end }}
221221

222222
{{- if and (.Values.deployment.env.ENABLE_IMAP) (not .Values.deployment.env.SMTP_ONLY) }}
223223
- name: imap
@@ -229,8 +229,8 @@ spec:
229229
containerPort: 10143
230230
- name: imaps-proxy
231231
containerPort: 10993
232-
{{- end }}
233-
{{- end }}
232+
{{- end }}
233+
{{- end }}
234234

235235
{{- if and (.Values.deployment.env.ENABLE_POP3) (not .Values.deployment.env.SMTP_ONLY) }}
236236
- name: pop3
@@ -242,29 +242,29 @@ spec:
242242
containerPort: 10110
243243
- name: pop3s-proxy
244244
containerPort: 10995
245-
{{- end }}
246-
{{- end }}
245+
{{- end }}
246+
{{- end }}
247247

248248
{{- if .Values.deployment.env.ENABLE_RSPAMD }}
249249
- name: rspamd
250-
containerPort: 11334
251-
{{- end }}
250+
containerPort: 11334
251+
{{- end }}
252252

253253
{{- if and (.Values.deployment.env.ENABLE_MANAGESIEVE) (not .Values.deployment.env.SMTP_ONLY) }}
254254
- name: managesieve
255-
containerPort: 4190
255+
containerPort: 4190
256256
{{- if .Values.proxyProtocol.enabled }}
257257
- name: msieve-proxy
258258
containerPort: 14190
259-
{{- end }}
260-
{{- end }}
259+
{{- end }}
260+
{{- end }}
261261

262262
{{- if .Values.metrics.enabled }}
263263
- name: metrics-exporter
264264
image: {{ .Values.metrics.image.name }}:{{ .Values.metrics.image.tag }}
265265
imagePullPolicy: {{ .Values.metrics.image.pullPolicy }}
266266
command: ["/bin/postfix_exporter"]
267-
args:
267+
args:
268268
- "--postfix.showq_path"
269269
- "/var/mail-state/spool-postfix/public/showq"
270270
- "--postfix.logfile_path"
@@ -279,7 +279,7 @@ spec:
279279
{{- if and .Values.metrics.resizePolicy (semverCompare ">=1.33-0" .Capabilities.KubeVersion.Version) }}
280280
resizePolicy:
281281
{{ toYaml .Values.metrics.resizePolicy | indent 12 }}
282-
{{- end }}
282+
{{- end }}
283283
securityContext:
284284
{{ toYaml .Values.deployment.containerSecurityContext | indent 12 }}
285285

charts/docker-mailserver/templates/pvc.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ metadata:
66
name: {{ template "dockermailserver.fullname" $ }}-{{ $name }}
77
{{- if $pvc.annotations }}
88
annotations:
9-
{{ toYaml $pvc.annotations }}
9+
{{ toYaml $pvc.annotations }}
1010
{{ end }}
1111
spec:
1212
accessModes:
1313
{{ toYaml $pvc.accessModes | indent 2 }}
14-
14+
1515
{{- if $pvc.storageClass }}
1616
storageClassName: {{ $pvc.storageClass | quote }}
17-
{{- end }}
17+
{{- end }}
1818
resources:
1919
requests:
2020
storage: {{ $pvc.size | quote }}

charts/docker-mailserver/templates/servicemonitor.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ metadata:
1010
release: "{{ .Release.Name }}"
1111
{{- if .Values.metrics.serviceMonitor.labels }}
1212
{{ toYaml .Values.metrics.serviceMonitor.labels | indent 4 }}
13-
{{ end }}
13+
{{ end }}
1414
name: {{ template "dockermailserver.fullname" . }}
1515
spec:
1616
endpoints:

charts/docker-mailserver/values.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,7 @@ deployment:
224224
# set those unless you're using a secret
225225
#RELAY_PASSWORD:
226226

227-
securityContext:
228-
runAsUser: 5000
229-
runAsGroup: 5000
227+
securityContext: {}
230228

231229
containerSecurityContext:
232230
readOnlyRootFilesystem: false # incompatible with the way docker-mailserver works
@@ -618,7 +616,7 @@ configMaps:
618616
# Enable PROXY Protocol support for these new service variants:
619617
postconf -P 10587/inet/smtpd_upstream_proxy_protocol=haproxy
620618
postconf -P 10465/inet/smtpd_upstream_proxy_protocol=haproxy
621-
619+
622620
# Create a variant for port 25 too (NOTE: Port 10025 is already assigned in DMS to Amavis):
623621
postconf -Mf smtp/inet | sed -e s/^smtp/12525/ >> /etc/postfix/master.cf
624622
# Enable PROXY Protocol support:

0 commit comments

Comments
 (0)