Skip to content

Commit 3eaf308

Browse files
committed
feat(kontinuous): deploy MailDev on preprod as interim SMTP catcher
Mirrors the dev setup on preprod (Deployment + Service + Ingress + configmap pointing at the maildev service) so the team can inspect receipts while a Tipimail preprod sealed-secret is being provisioned. Drops MAIL_ENABLED back to true for preprod.
1 parent 4e924d9 commit 3eaf308

2 files changed

Lines changed: 101 additions & 5 deletions

File tree

.kontinuous/env/preprod/templates/mail.configmap.yaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ apiVersion: v1
33
metadata:
44
name: mail
55
data:
6-
# Kept false until a Tipimail preprod sealed-secret is generated for the
7-
# egapro-preprod namespace. Flip to "true" once the smtp-app sealed-secret
8-
# exists in this namespace.
9-
MAIL_ENABLED: "false"
10-
MAIL_FROM: "EgaPro preprod <no-reply@egapro.preprod.fabrique.social.gouv.fr>"
6+
# Using MailDev as an in-cluster SMTP catcher until a Tipimail preprod
7+
# sealed-secret is available. The UI is exposed at
8+
# https://maildev-<global.host> via the maildev Ingress.
9+
MAIL_ENABLED: "true"
10+
SMTP_HOST: "maildev"
11+
SMTP_PORT: "1025"
12+
MAIL_FROM: "no-reply@egapro.preprod.fabrique.social.gouv.fr"
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: maildev
5+
namespace: {{ .Values.global.namespace }}
6+
labels:
7+
app: maildev
8+
spec:
9+
replicas: 1
10+
selector:
11+
matchLabels:
12+
app: maildev
13+
template:
14+
metadata:
15+
labels:
16+
app: maildev
17+
spec:
18+
securityContext:
19+
runAsNonRoot: true
20+
runAsUser: 1000
21+
containers:
22+
- name: maildev
23+
image: maildev/maildev:2.2.1
24+
securityContext:
25+
allowPrivilegeEscalation: false
26+
readOnlyRootFilesystem: true
27+
capabilities:
28+
drop: ["ALL"]
29+
ports:
30+
- name: smtp
31+
containerPort: 1025
32+
- name: web
33+
containerPort: 1080
34+
readinessProbe:
35+
httpGet:
36+
path: /
37+
port: web
38+
initialDelaySeconds: 5
39+
periodSeconds: 10
40+
resources:
41+
requests:
42+
cpu: 10m
43+
memory: 64Mi
44+
limits:
45+
cpu: 200m
46+
memory: 256Mi
47+
volumeMounts:
48+
- name: tmp
49+
mountPath: /tmp
50+
volumes:
51+
- name: tmp
52+
emptyDir: {}
53+
---
54+
apiVersion: v1
55+
kind: Service
56+
metadata:
57+
name: maildev
58+
namespace: {{ .Values.global.namespace }}
59+
spec:
60+
selector:
61+
app: maildev
62+
ports:
63+
- name: smtp
64+
port: 1025
65+
targetPort: smtp
66+
- name: web
67+
port: 1080
68+
targetPort: web
69+
---
70+
apiVersion: networking.k8s.io/v1
71+
kind: Ingress
72+
metadata:
73+
name: maildev
74+
namespace: {{ .Values.global.namespace }}
75+
annotations:
76+
cert-manager.io/cluster-issuer: letsencrypt-prod
77+
nginx.ingress.kubernetes.io/ssl-redirect: "true"
78+
spec:
79+
ingressClassName: nginx
80+
tls:
81+
- hosts:
82+
- maildev-{{ .Values.global.host }}
83+
secretName: maildev-tls
84+
rules:
85+
- host: maildev-{{ .Values.global.host }}
86+
http:
87+
paths:
88+
- path: /
89+
pathType: Prefix
90+
backend:
91+
service:
92+
name: maildev
93+
port:
94+
name: web

0 commit comments

Comments
 (0)