-
Notifications
You must be signed in to change notification settings - Fork 147
Expand file tree
/
Copy pathdeployment.yaml
More file actions
208 lines (208 loc) · 9.24 KB
/
deployment.yaml
File metadata and controls
208 lines (208 loc) · 9.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
---
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: {{ .Values.front.kind }}
metadata:
name: {{ printf "%s-front" (include "mailu.fullname" .) }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: front
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if eq .Values.front.kind "Deployment" }}
replicas: {{ .Values.front.replicaCount }}
{{- end }}
{{- if and .Values.front.updateStrategy (eq .Values.front.kind "Deployment") }}
strategy: {{- toYaml .Values.front.updateStrategy | nindent 4 }}
{{- end }}
{{- if and .Values.front.updateStrategy (eq .Values.front.kind "DaemonSet") }}
updateStrategy: {{- toYaml .Values.front.updateStrategy | nindent 4 }}
{{- end }}
revisionHistoryLimit: {{ .Values.front.revisionHistoryLimit }}
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
app.kubernetes.io/component: front
template:
metadata:
labels: {{- include "common.labels.standard" . | nindent 8 }}
app.kubernetes.io/component: front
{{- if .Values.front.podLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.front.podLabels "context" $) | nindent 8 }}
{{- end }}
annotations:
checksum/envvars-configmap.yaml: {{ include (print .Template.BasePath "/envvars-configmap.yaml") . | sha256sum }}
{{- if .Values.front.podAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.front.podAnnotations "context" $) | nindent 8 }}
{{- end }}
spec:
{{- include "common.images.pullSecrets" (dict "images" (list .Values.front.image) "global" .Values.global) | nindent 6 }}
{{- if .Values.front.hostAliases }}
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.front.hostAliases "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.front.nodeSelector }}
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.front.nodeSelector "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.front.affinity }}
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.front.affinity "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.front.tolerations }}
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.front.tolerations "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.front.priorityClassName }}
priorityClassName: {{ .Values.front.priorityClassName | quote }}
{{- end }}
{{- if .Values.front.schedulerName }}
schedulerName: {{ .Values.front.schedulerName | quote }}
{{- end }}
{{- if .Values.front.topologySpreadConstraints }}
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.front.topologySpreadConstraints "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.front.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.front.terminationGracePeriodSeconds }}
{{- end }}
{{- if .Values.front.initContainers }}
initContainers: {{- include "common.tplvalues.render" (dict "value" .Values.front.initContainers "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.front.podSecurityContext.enabled }}
securityContext: {{- omit .Values.front.podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
containers:
- name: front
image: {{ .Values.imageRegistry }}/{{ .Values.front.image.repository }}:{{ default (include "mailu.version" .) .Values.front.image.tag }}
imagePullPolicy: {{ .Values.front.image.pullPolicy }}
{{- if .Values.front.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.front.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
volumeMounts:
- name: certs
mountPath: /certs
{{- if .Values.front.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.front.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
env:
- name: LOG_LEVEL
value: {{ default .Values.logLevel .Values.front.logLevel }}
{{- tpl (include "mailu.envvars.secrets" .) $ | nindent 12 }}
{{- if .Values.front.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.front.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
envFrom:
- configMapRef:
name: {{ printf "%s-envvars" (include "mailu.fullname" .) }}
{{- if .Values.front.extraEnvVarsCM }}
- configMapRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.front.extraEnvVarsCM "context" $) }}
{{- end }}
{{- if .Values.front.extraEnvVarsSecret }}
- secretRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.front.extraEnvVarsSecret "context" $) }}
{{- end }}
ports:
- name: pop3
protocol: TCP
containerPort: 110
{{- if .Values.front.hostPort.enabled }}
hostPort: 110
{{- end}}
- name: pop3s
protocol: TCP
containerPort: 995
{{- if .Values.front.hostPort.enabled }}
hostPort: 995
{{- end}}
- name: imap
protocol: TCP
containerPort: 143
{{- if .Values.front.hostPort.enabled }}
hostPort: 143
{{- end}}
- name: imaps
protocol: TCP
containerPort: 993
{{- if .Values.front.hostPort.enabled }}
hostPort: 993
{{- end}}
- name: smtp
protocol: TCP
containerPort: 25
{{- if .Values.front.hostPort.enabled }}
hostPort: 25
{{- end}}
- name: smtps
protocol: TCP
containerPort: 465
{{- if .Values.front.hostPort.enabled }}
hostPort: 465
{{- end}}
- name: smtp-auth
protocol: TCP
containerPort: 10025
- name: imap-auth
protocol: TCP
containerPort: 10143
- name: smtpd
protocol: TCP
containerPort: 587
{{- if .Values.front.hostPort.enabled }}
hostPort: 587
{{- end}}
- name: auth
containerPort: 8000
protocol: TCP
- name: http
containerPort: 80
protocol: TCP
- name: sieve
containerPort: 14190
protocol: TCP
{{ if not .Values.ingress.enabled }}
- name: https
containerPort: 443
protocol: TCP
{{end}}
{{- if .Values.front.resources }}
resources: {{- toYaml .Values.front.resources | nindent 12 }}
{{- end }}
{{- if .Values.front.startupProbe.enabled }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.front.startupProbe "enabled") "context" $) | nindent 12 }}
exec:
command:
- sh
- -c
- 'curl -skfLo /dev/null http://127.0.0.1:10204/health && kill -0 `cat /run/dovecot/master.pid`'
{{- end }}
{{- if .Values.front.livenessProbe.enabled }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.front.livenessProbe "enabled") "context" $) | nindent 12 }}
exec:
command:
- sh
- -c
- 'curl -skfLo /dev/null http://127.0.0.1:10204/health && kill -0 `cat /run/dovecot/master.pid`'
{{- end }}
{{- if .Values.front.readinessProbe.enabled }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.front.readinessProbe "enabled") "context" $) | nindent 12 }}
exec:
command:
- sh
- -c
- 'curl -skfLo /dev/null http://127.0.0.1:10204/health && kill -0 `cat /run/dovecot/master.pid`'
{{- end }}
{{- if .Values.front.extraContainers }}
{{- toYaml .Values.front.extraContainers | nindent 8 }}
{{- end }}
volumes:
- name: certs
secret:
items:
- key: tls.crt
path: cert.pem
- key: tls.key
path: key.pem
secretName: {{ include "mailu.certificatesSecretName" . }}
{{- if .Values.front.extraVolumes }}
{{- include "common.tplvalues.render" (dict "value" .Values.front.extraVolumes "context" $) | nindent 8 }}
{{- end }}