blob: ccc423a46b826f9301df91a292f8365fa1152ea6 [file] [log] [blame]
giolekva7fe15192021-11-19 13:58:16 +04001apiVersion: v1
2kind: Service
3metadata:
4 name: maddy
5 namespace: {{ .Release.Namespace }}
6spec:
7 type: ClusterIP
8 selector:
9 app: maddy
10 ports:
11 - name: imap
12 port: 143
13 protocol: TCP
14 - name: imaps
15 port: 993
16 protocol: TCP
17 - name: smtp
18 port: 25
19 protocol: TCP
20 - name: smtps
21 port: 465
22 protocol: TCP
23 - name: submission
24 port: 587
25 protocol: TCP
26---
27apiVersion: v1
28kind: Service
29metadata:
30 name: manage
31 namespace: {{ .Release.Namespace }}
32spec:
33 type: ClusterIP
34 selector:
35 app: maddy
36 ports:
37 - name: http
38 port: 80
39 targetPort: http
40 protocol: TCP
41---
42apiVersion: networking.k8s.io/v1
43kind: Ingress
44metadata:
45 name: manage
46 namespace: {{ .Release.Namespace }}
47spec:
48 ingressClassName: {{ .Values.ingress.private.className }}
49 tls:
50 - hosts:
51 - mail.{{ .Values.ingress.private.domain }}
giolekvaee3a57b2021-12-01 16:18:23 +040052 secretName: cert-wildcard.{{ .Values.ingress.private.domain }}
giolekva7fe15192021-11-19 13:58:16 +040053 rules:
54 - host: mail.{{ .Values.ingress.private.domain }}
55 http:
56 paths:
57 - path: /
58 pathType: Prefix
59 backend:
60 service:
61 name: manage
62 port:
63 name: http
64---
65apiVersion: cert-manager.io/v1
66kind: Certificate
67metadata:
68 name: mail.{{ .Values.ingress.public.domain }}
69 namespace: {{ .Release.Namespace }}
70 annotations:
giolekva26a96812021-12-03 13:36:02 +040071 helm.sh/resource-policy: keep
giolekva7fe15192021-11-19 13:58:16 +040072spec:
73 dnsNames:
74 - 'mail.{{ .Values.ingress.public.domain }}'
75 issuerRef:
76 name: {{ .Values.ingress.public.certificateIssuer }}
77 kind: ClusterIssuer
78 secretName: cert-mail.{{ .Values.ingress.public.domain }}
79---
80apiVersion: v1
81kind: PersistentVolumeClaim
82metadata:
83 name: data
84 namespace: {{ .Release.Namespace }}
85spec:
86 accessModes:
87 - ReadWriteOnce
88 resources:
89 requests:
90 storage: {{ .Values.storage.size }}
91---
92apiVersion: apps/v1
93kind: Deployment
94metadata:
95 name: maddy
96 namespace: {{ .Release.Namespace }}
97spec:
98 selector:
99 matchLabels:
100 app: maddy
101 replicas: 1
102 template:
103 metadata:
104 labels:
105 app: maddy
giolekva75ee2712021-11-26 13:57:12 +0400106 annotations:
107 checksum/config: {{ include (print $.Template.BasePath "/config.yaml") . | sha256sum }}
giolekva7fe15192021-11-19 13:58:16 +0400108 spec:
109 volumes:
110 - name: config
111 configMap:
112 name: config
113 - name: certs
114 secret:
115 secretName: cert-mail.{{ .Values.ingress.public.domain}}
giolekva75ee2712021-11-26 13:57:12 +0400116 - name: certs-private
117 secret:
118 secretName: cert-wildcard.{{ .Values.ingress.private.domain}}
giolekva7fe15192021-11-19 13:58:16 +0400119 - name: data
120 persistentVolumeClaim:
121 claimName: data
122 containers:
123 - name: maddy
124 image: giolekva/maddy:v0.4.4
125 imagePullPolicy: Always
126 ports:
127 - name: imap
128 containerPort: 143
129 protocol: TCP
130 - name: imaps
131 containerPort: 993
132 protocol: TCP
133 - name: smtp
134 containerPort: 25
135 protocol: TCP
136 - name: smtps
137 containerPort: 465
138 protocol: TCP
139 - name: submission
140 containerPort: 587
141 protocol: TCP
142 command:
143 - maddy
144 - -config
145 - /etc/maddy/config/maddy.conf
146 volumeMounts:
147 - name: config
148 mountPath: /etc/maddy/config
giolekva75ee2712021-11-26 13:57:12 +0400149 readOnly: true
150 - name: certs-private
151 mountPath: /etc/maddy/certs-private
152 readOnly: true
giolekva7fe15192021-11-19 13:58:16 +0400153 - name: data
154 mountPath: /var/lib/maddy
giolekva75ee2712021-11-26 13:57:12 +0400155 readOnly: false
giolekva7fe15192021-11-19 13:58:16 +0400156 - name: web
157 image: giolekva/maddy-web:latest
158 imagePullPolicy: Always
159 ports:
160 - name: http
161 containerPort: 80
162 protocol: TCP
163 command:
164 - maddy-web
165 - --port=80
166 - --maddy-config=/etc/maddy/config/maddy.conf
giolekva7fe15192021-11-19 13:58:16 +0400167 volumeMounts:
168 - name: config
169 mountPath: /etc/maddy/config
giolekva75ee2712021-11-26 13:57:12 +0400170 readOnly: true
giolekva7fe15192021-11-19 13:58:16 +0400171 - name: certs
172 mountPath: /etc/maddy/certs
giolekva75ee2712021-11-26 13:57:12 +0400173 readOnly: true
giolekva7fe15192021-11-19 13:58:16 +0400174 - name: data
175 mountPath: /var/lib/maddy
giolekva75ee2712021-11-26 13:57:12 +0400176 readOnly: false