blob: 5aaef1d003a5d37bd7917e6c580544fe02699db9 [file] [log] [blame]
Matthias Andreas Benkard3cf43e32026-11-05 22:28:28 +01001---
2apiVersion: extensions/v1beta1
3kind: Ingress
4metadata:
5 name: mailcow
6 namespace: mulk
7 labels:
8 name: mailcow
9 k8s-app: mailcow
10 annotations:
11 kubernetes.io/ingress.class: traefik
12 traefik.ingress.kubernetes.io/preserve-host: "true"
13spec:
14 rules:
15 - host: mail.benkard.de
16 http:
17 paths:
18 - path: /
19 backend:
20 serviceName: mailcow
21 servicePort: 80
22 - host: autodiscover.benkard.de
23 http:
24 paths:
25 - path: /
26 backend:
27 serviceName: mailcow
28 servicePort: 80
29
30---
31apiVersion: v1
32kind: Service
33metadata:
34 name: mailcow-pub
35 namespace: mulk
36 labels:
37 name: mailcow-pub
38 k8s-app: mailcow
39spec:
40 selector:
41 name: mailcow
42 type: NodePort
43 externalTrafficPolicy: Local
44 ports:
45 - name: smtp-alt
46 port: 31025
47 targetPort: 25
48 protocol: TCP
49 nodePort: 31025
50---
51apiVersion: v1
52kind: Service
53metadata:
54 name: mailcow
55 namespace: mulk
56 labels:
57 name: mailcow
58 k8s-app: mailcow
59spec:
60 selector:
61 name: mailcow
62 type: ClusterIP
63 ports:
64 - name: http
65 port: 80
66 targetPort: 80
67 protocol: TCP
68---
69apiVersion: apps/v1
70kind: Deployment
71metadata:
72 name: mailcow
73 namespace: mulk
74 labels:
75 name: mailcow
76 k8s-app: mailcow
77spec:
78 replicas: 1
79 strategy:
80 rollingUpdate:
81 maxSurge: 1
82 maxUnavailable: 1
83 selector:
84 matchLabels:
85 k8s-app: mailcow
86 name: mailcow
87 template:
88 metadata:
89 labels:
90 name: mailcow
91 k8s-app: mailcow
92 spec:
93 imagePullSecrets:
94 - name: kube-registry-token
95 hostAliases:
96 - ip: "127.0.0.1"
97 hostnames:
98 - "mysql"
99 - "mysql-mailcow"
100 - "mysql-proxy"
101 - "redis"
102 - "redis-mailcow"
103 - "clamd"
104 - "clamd-mailcow"
105 - "dockerapi"
106 - "dockerapi-mailcow"
107 - "solr"
108 - "solr-mailcow"
109 - "watchdog"
110 - "watchdog-mailcow"
111 - "acme"
112 - "acme-mailcow"
113 - "nginx"
114 - "nginx-mailcow"
115 - "memcached"
116 - "memcached-mailcow"
117 - "postfix"
118 - "postfix-mailcow"
119 - "dovecot"
120 - "dovecot-mailcow"
121 - "sogo"
122 - "sogo-mailcow"
123 - "phpfpm"
124 - "phpfpm-mailcow"
125 - "rspamd"
126 - "rspamd-mailcow"
127 - "unbound"
128 - "unbound-mailcow"
129 containers:
130 - name: mysql-proxy
131 image: alpine/socat:1.0.3
132 args:
133 - UNIX-LISTEN:/var/run/mysqld/mysqld.sock,reuseaddr,fork,unlink-early,mode=0777
134 - TCP-CONNECT:mysql.system.svc.cluster.local.:3306
135 volumeMounts:
136 - name: mysql-socket
137 mountPath: /var/run/mysqld
138 - name: redis
139 image: redis:5-alpine
140 env:
141 - name: TZ
142 value: Europe/Vienna
143 volumeMounts:
144 - name: redis-data
145 mountPath: /data
146 - name: clamd
147 image: mailcow/clamd:1.35
148 env:
149 - name: TZ
150 value: Europe/Vienna
151 - name: SKIP_CLAMD
152 value: "y"
153 volumeMounts:
154 - name: config
155 subPath: clamav
156 mountPath: /etc/clamav
157 - name: clamav-data
158 mountPath: /var/lib/clamav
159 - name: rspamd
160 image: mailcow/rspamd:1.57
161 env:
162 - name: TZ
163 value: Europe/Vienna
164 - name: DOVECOT_V4
165 value: 127.0.0.1
166 volumeMounts:
167 - name: rspamd-data
168 mountPath: /var/lib/rspamd
169 - name: config
170 subPath: rspamd/custom
171 mountPath: /etc/rspamd/custom
172 - name: config
173 subPath: rspamd/override.d
174 mountPath: /etc/rspamd/override.d
175 - name: config
176 subPath: rspamd/local.d
177 mountPath: /etc/rspamd/local.d
178 - name: config
179 subPath: rspamd/lua/
180 mountPath: /etc/rspamd/lua
181 readOnly: true
182 - name: php-fpm
183 image: mailcow/phpfpm:1.55
184 command:
185 - php-fpm
186 - -d
187 - date.timezone=Europe/Vienna
188 - -d
189 - expose_php=0
190 env:
191 - {name: LOG_LINES, value: "9999"}
192 - {name: TZ, value: Europe/Vienna}
193 - {name: DBNAME, value: mailcow}
194 - {name: DBUSER, value: mailcow}
195 - {name: DBPASS, value: REDACTED}
196 - {name: MAILCOW_HOSTNAME, value: mail.benkard.de}
197 - {name: IMAP_PORT, value: "143"}
198 - {name: IMAPS_PORT, value: "993"}
199 - {name: POP_PORT, value: "110"}
200 - {name: POPS_PORT, value: "995"}
201 - {name: SIEVE_PORT, value: "4190"}
202 - {name: SUBMISSION_PORT, value: "587"}
203 - {name: SMTPS_PORT, value: "465"}
204 - {name: SMTP_PORT, value: "25"}
205 - {name: API_KEY, value: invalid}
206 - {name: API_ALLOW_FROM, value: invalid}
207 - {name: COMPOSE_PROJECT_NAME, value: mailcow-dockerized}
208 - {name: SKIP_SOLR, value: "y"}
209 volumeMounts:
210 - name: web-data
211 mountPath: /web
212 - name: config
213 subPath: rspamd/dynmaps
214 mountPath: /dynmaps
215 readOnly: true
216 - name: rspamd-data
217 mountPath: /var/lib/rspamd
218 - name: config
219 subPath: sogo
220 mountPath: /etc/sogo
221 - name: config
222 subPath: rspamd/meta_exporter
223 mountPath: /meta_exporter
224 readOnly: true
225 - name: config
226 subPath: phpfpm/php-fpm.d/pools.conf
227 mountPath: /usr/local/etc/php-fpm.d/z-pools.conf
228 - name: config
229 subPath: phpfpm/php-conf.d/opcache-recommended.ini
230 mountPath: /usr/local/etc/php/conf.d/opcache-recommended.ini
231 - name: config
232 subPath: phpfpm/php-conf.d/upload.ini
233 mountPath: /usr/local/etc/php/conf.d/upload.ini
234 - name: config
235 subPath: phpfpm/php-conf.d/other.ini
236 mountPath: /usr/local/etc/php/conf.d/zzz-other.ini
237 - name: mysql-socket
238 mountPath: /var/run/mysqld
239 - name: sogo
240 image: mailcow/sogo:1.65
241 command:
242 - /bin/sleep
243 - inf
244 env:
245 - {name: DBNAME, value: mailcow}
246 - {name: DBUSER, value: mailcow}
247 - {name: DBPASS, value: REDACTED}
248 - {name: TZ, value: Europe/Vienna}
249 - {name: LOG_LINES, value: "9999"}
250 - {name: MAILCOW_HOSTNAME, value: mail.benkard.de}
251 - {name: ACL_ANYONE, value: disallow}
252 volumeMounts:
253 - name: config
254 subPath: sogo
255 mountPath: /etc/sogo
256 - name: config
257 subPath: sogo/custom-sogo.js
258 mountPath: /usr/lib/GNUstep/SOGo/WebServerResources/js/custom-sogo.js
259 - name: web-data
260 subPath: inc/init_db.inc.php
261 mountPath: /init_db.inc.php
262 - name: mysql-socket
263 mountPath: /var/run/mysqld
264 - name: dovecot
265 image: mailcow/dovecot:1.54
266 tty: true
267 env:
268 - {name: DBNAME, value: mailcow}
269 - {name: DBUSER, value: mailcow}
270 - {name: DBPASS, value: REDACTED}
271 - {name: TZ, value: Europe/Vienna}
272 - {name: LOG_LINES, value: "9999"}
273 - {name: MAILDIR_GC_TIME, value: "1440"}
274 - {name: ACL_ANYONE, value: disallow}
275 volumeMounts:
276 - name: config
277 subPath: dovecot
278 mountPath: /usr/local/etc/dovecot
279 - name: assets
280 subPath: ssl
281 mountPath: /etc/ssl/mail
282 readOnly: true
283 - name: config
284 subPath: sogo
285 mountPath: /etc/sogo/
286 - name: vmail
287 mountPath: /var/vmail
288 - name: vmail-attachments
289 mountPath: /var/attachments
290 - name: crypt-data
291 mountPath: /mail_crypt
292 - name: config
293 subPath: rspamd/custom
294 mountPath: /etc/rspamd/custom
295 - name: rspamd-data
296 mountPath: /var/lib/rspamd
297 - name: mysql-socket
298 mountPath: /var/run/mysqld
299 ports:
300 - name: doveadm
301 hostPort: 19991
302 containerPort: 12345
303 - name: imap
304 hostPort: 143
305 containerPort: 143
306 - name: imaps
307 hostPort: 993
308 containerPort: 993
309 - name: pop
310 hostPort: 110
311 containerPort: 110
312 - name: pops
313 hostPort: 995
314 containerPort: 995
315 - name: sieve
316 hostPort: 4190
317 containerPort: 4190
318 - name: postfix
319 image: mailcow/postfix:1.44
320 volumeMounts:
321 - name: config
322 subPath: postfix
323 mountPath: /opt/postfix/conf
324 - name: assets
325 subPath: ssl
326 mountPath: /etc/ssl/mail
327 readOnly: true
328 - name: postfix-data
329 mountPath: /var/spool/postfix
330 - name: crypt-data
331 mountPath: /var/lib/zeyple
332 - name: rspamd-data
333 mountPath: /var/lib/rspamd
334 - name: mysql-socket
335 mountPath: /var/run/mysqld
336 env:
337 - {name: LOG_LINES, value: "9999"}
338 - {name: TZ, value: Europe/Vienna}
339 - {name: DBNAME, value: mailcow}
340 - {name: DBUSER, value: mailcow}
341 - {name: DBPASS, value: REDACTED}
342 ports:
343 - name: smtp
344 hostPort: 25
345 containerPort: 25
346 - name: smtps
347 hostPort: 465
348 containerPort: 465
349 - name: submission
350 hostPort: 587
351 containerPort: 587
352 - name: memcached
353 image: memcached:1.5.16
354 - name: nginx
355 image: nginx:1.17.0-alpine
356 command:
357 - /bin/sh
358 - -c
359 - envsubst < /etc/nginx/conf.d/templates/listen_plain.template > /etc/nginx/conf.d/listen_plain.active &&
360 envsubst < /etc/nginx/conf.d/templates/listen_ssl.template > /etc/nginx/conf.d/listen_ssl.active &&
361 envsubst < /etc/nginx/conf.d/templates/server_name.template > /etc/nginx/conf.d/server_name.active &&
362 envsubst < /etc/nginx/conf.d/templates/sogo.template > /etc/nginx/conf.d/sogo.active &&
363 envsubst < /etc/nginx/conf.d/templates/sogo_eas.template > /etc/nginx/conf.d/sogo_eas.active &&
364 nginx -t &&
365 exec nginx -g 'daemon off;'
366 env:
367 - {name: HTTPS_PORT, value: "443"}
368 - {name: HTTP_PORT, value: "80"}
369 - {name: MAILCOW_HOSTNAME, value: mail.benkard.de}
370 #- {name: IPV4_NETWORK, value: ${IPV4_NETWORK:-172.22.1}}
371 - {name: TZ, value: Europe/Vienna}
372 volumeMounts:
373 - name: web-data
374 mountPath: /web
375 readOnly: true
376 - name: config
377 subPath: rspamd/dynmaps
378 mountPath: /dynmaps
379 readOnly: true
380 - name: assets
381 subPath: ssl
382 mountPath: /etc/ssl/mail
383 readOnly: true
384 - name: config
385 subPath: nginx
386 mountPath: /etc/nginx/conf.d
387 - name: config
388 subPath: rspamd/meta_exporter
389 mountPath: /meta_exporter
390 readOnly: true
391 ports:
392 - name: http
393 containerPort: 80
394 - name: acme
395 image: mailcow/acme:1.70
396 env:
397 - {name: LOG_LINES, value: "9999"}
398 - {name: ADDITIONAL_SAN, value: ""}
399 - {name: MAILCOW_HOSTNAME, value: mail.benkard.de}
400 - {name: DBNAME, value: mailcow}
401 - {name: DBUSER, value: mailcow}
402 - {name: DBPASS, value: REDACTED}
403 - {name: SKIP_LETS_ENCRYPT, value: "n"}
404 - {name: SKIP_IP_CHECK, value: "y"}
405 - {name: LE_STAGING, value: "n"}
406 - {name: TZ, value: Europe/Vienna}
407 volumeMounts:
408 - name: web-data
409 subPath: .well-known/acme-challenge
410 mountPath: /var/www/acme
411 - name: assets
412 subPath: ssl
413 mountPath: /var/lib/acme
414 - name: assets
415 subPath: ssl-example
416 mountPath: /var/lib/ssl-example
417 readOnly: true
418 - name: mysql-socket
419 mountPath: /var/run/mysqld
420 volumes:
421 - name: web-data
422 persistentVolumeClaim:
423 claimName: mailcow-web
424 - name: assets
425 persistentVolumeClaim:
426 claimName: mailcow-assets
427 - name: vmail
428 persistentVolumeClaim:
429 claimName: mailcow-vmail
430 - name: vmail-attachments
431 persistentVolumeClaim:
432 claimName: mailcow-vmail-attachments
433 - name: redis-data
434 persistentVolumeClaim:
435 claimName: mailcow-redis
436 - name: rspamd-data
437 persistentVolumeClaim:
438 claimName: mailcow-rspamd
439 - name: postfix-data
440 persistentVolumeClaim:
441 claimName: mailcow-postfix
442 - name: crypt-data
443 persistentVolumeClaim:
444 claimName: mailcow-crypt
445 - name: config
446 persistentVolumeClaim:
447 claimName: mailcow-config
448 - name: mysql-socket
449 emptyDir: {}
450 - name: clamav-data
451 emptyDir: {}
452---
453apiVersion: v1
454kind: PersistentVolumeClaim
455metadata:
456 name: mailcow-web
457 namespace: mulk
458 labels:
459 k8s-app: mailcow
460 annotations:
461 volume.beta.kubernetes.io/storage-provisioner: rancher.io/local-path
462spec:
463 storageClassName: local-path
464 accessModes:
465 - ReadWriteOnce
466 resources:
467 requests:
468 storage: 1Gi
469---
470apiVersion: v1
471kind: PersistentVolumeClaim
472metadata:
473 name: mailcow-assets
474 namespace: mulk
475 labels:
476 k8s-app: mailcow
477 annotations:
478 volume.beta.kubernetes.io/storage-provisioner: rancher.io/local-path
479spec:
480 storageClassName: local-path
481 accessModes:
482 - ReadWriteOnce
483 resources:
484 requests:
485 storage: 1Gi
486---
487apiVersion: v1
488kind: PersistentVolumeClaim
489metadata:
490 name: mailcow-vmail
491 namespace: mulk
492 labels:
493 k8s-app: mailcow
494 annotations:
495 volume.beta.kubernetes.io/storage-provisioner: rancher.io/local-path
496spec:
497 storageClassName: local-path
498 accessModes:
499 - ReadWriteOnce
500 resources:
501 requests:
502 storage: 1Gi
503---
504apiVersion: v1
505kind: PersistentVolumeClaim
506metadata:
507 name: mailcow-vmail-attachments
508 namespace: mulk
509 labels:
510 k8s-app: mailcow
511 annotations:
512 volume.beta.kubernetes.io/storage-provisioner: rancher.io/local-path
513spec:
514 storageClassName: local-path
515 accessModes:
516 - ReadWriteOnce
517 resources:
518 requests:
519 storage: 1Gi
520---
521apiVersion: v1
522kind: PersistentVolumeClaim
523metadata:
524 name: mailcow-redis
525 namespace: mulk
526 labels:
527 k8s-app: mailcow
528 annotations:
529 volume.beta.kubernetes.io/storage-provisioner: rancher.io/local-path
530spec:
531 storageClassName: local-path
532 accessModes:
533 - ReadWriteOnce
534 resources:
535 requests:
536 storage: 1Gi
537---
538apiVersion: v1
539kind: PersistentVolumeClaim
540metadata:
541 name: mailcow-rspamd
542 namespace: mulk
543 labels:
544 k8s-app: mailcow
545 annotations:
546 volume.beta.kubernetes.io/storage-provisioner: rancher.io/local-path
547spec:
548 storageClassName: local-path
549 accessModes:
550 - ReadWriteOnce
551 resources:
552 requests:
553 storage: 1Gi
554---
555apiVersion: v1
556kind: PersistentVolumeClaim
557metadata:
558 name: mailcow-postfix
559 namespace: mulk
560 labels:
561 k8s-app: mailcow
562 annotations:
563 volume.beta.kubernetes.io/storage-provisioner: rancher.io/local-path
564spec:
565 storageClassName: local-path
566 accessModes:
567 - ReadWriteOnce
568 resources:
569 requests:
570 storage: 1Gi
571---
572apiVersion: v1
573kind: PersistentVolumeClaim
574metadata:
575 name: mailcow-crypt
576 namespace: mulk
577 labels:
578 k8s-app: mailcow
579 annotations:
580 volume.beta.kubernetes.io/storage-provisioner: rancher.io/local-path
581spec:
582 storageClassName: local-path
583 accessModes:
584 - ReadWriteOnce
585 resources:
586 requests:
587 storage: 1Gi
588---
589apiVersion: v1
590kind: PersistentVolumeClaim
591metadata:
592 name: mailcow-config
593 namespace: mulk
594 labels:
595 k8s-app: mailcow
596 annotations:
597 volume.beta.kubernetes.io/storage-provisioner: rancher.io/local-path
598spec:
599 storageClassName: local-path
600 accessModes:
601 - ReadWriteOnce
602 resources:
603 requests:
604 storage: 1Gi
605---
606#kind: ConfigMap
607#apiVersion: v1
608#metadata:
609# name: mailcow-config
610# namespace: mulk
611# labels:
612# k8s-app: mailcow
613#data:
614# gerrit.config: |
615# [gerrit]
616# basePath = git
617# canonicalWebUrl = https://gerrit.benkard.de/
618# serverId = 4f1749e7-9b7f-449e-acf9-5e80b87f8173