0d89a69c18
- stalwart namespace with Deployment + HPA (2-6 replicas) - CNPG PostgreSQL cluster (3 instances, 20Gi cephrbd-fast-delete) with PgBouncer pooler - S3/Ceph-RGW for blob storage (stalwart-maildata bucket, lz4 compressed) - Secrets from Vault: postgres-credentials, s3-credentials, stalwart-admin - TLS cert via cert-manager (vault-issuer) for mail.main.unkin.net - SMTP relay on port 25 (internal ClusterIP, trusted pod CIDRs) - Submission on port 587, IMAP 143/993, HTTPS 443 via LoadBalancer - HTTP port 8080 for Traefik reverse proxy (web admin at mail.k8s.syd1.au.unkin.net) - Outbound mail routed through postfix.mailgateway.svc.cluster.local:25 - Spam filtering offloaded to postfix/rspamd (disabled internally)
55 lines
1.0 KiB
YAML
55 lines
1.0 KiB
YAML
---
|
|
# Internal service - postfix connects here to deliver inbound mail
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: stalwart
|
|
namespace: stalwart
|
|
spec:
|
|
selector:
|
|
app: stalwart
|
|
ports:
|
|
- name: smtp-relay
|
|
port: 25
|
|
targetPort: 25
|
|
protocol: TCP
|
|
- name: http-internal
|
|
port: 8080
|
|
targetPort: 8080
|
|
protocol: TCP
|
|
- name: metrics
|
|
port: 9090
|
|
targetPort: 9090
|
|
protocol: TCP
|
|
---
|
|
# External LoadBalancer for user-facing mail services
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: stalwart-external
|
|
namespace: stalwart
|
|
annotations:
|
|
external-dns.alpha.kubernetes.io/hostname: mail.main.unkin.net
|
|
spec:
|
|
type: LoadBalancer
|
|
externalTrafficPolicy: Local
|
|
selector:
|
|
app: stalwart
|
|
ports:
|
|
- name: submission
|
|
port: 587
|
|
targetPort: 587
|
|
protocol: TCP
|
|
- name: imap
|
|
port: 143
|
|
targetPort: 143
|
|
protocol: TCP
|
|
- name: imaps
|
|
port: 993
|
|
targetPort: 993
|
|
protocol: TCP
|
|
- name: https
|
|
port: 443
|
|
targetPort: 443
|
|
protocol: TCP
|