This guide describes how to deploy docker-mailserver on Kubernetes with Kustomize. An external MySQL-compatible database is required; the kustomization does not provision a database.
A full example is in example-configs/kustomize/external-db-and-https-ingress.
- Kubernetes cluster with kubectl configured
- MySQL or Percona XtraDB (or compatible) database
- Domain and DNS (for ingress)
Copy .env.dist to .env, edit it, and create a ConfigMap from it. Create Kubernetes secrets for database credentials and other sensitive values. See Environment variables reference.
kubectl create namespace mailbin/create-tls-certs.shkubectl create -n mail secret tls tls-certs \
--cert=config/tls/tls.crt \
--key=config/tls/tls.keyFrom the project root:
kubectl apply -n mail -k .kubectl get pods -n mailWait until all pods are running and healthy.
kubectl exec -n mail -it deployment/web -c php-fpm -- setup.shUse the wizard to set initial configuration, create the first email address, and create an admin user.
Use your configured ingress and the admin credentials from the wizard.
- Configure DNS and TLS as for Docker. See How to configure DNS and How to configure TLS certificates.
- Change
DOVEADM_API_KEYfrom default if using observability (v7.3+).