https://github.com/bluedynamics/cdk8s-mailu
Mailu email setup as cdk8s-chart
https://github.com/bluedynamics/cdk8s-mailu
cdk8s chart email kubernetes kubernetes-deployment mail
Last synced: 29 days ago
JSON representation
Mailu email setup as cdk8s-chart
- Host: GitHub
- URL: https://github.com/bluedynamics/cdk8s-mailu
- Owner: bluedynamics
- License: apache-2.0
- Created: 2025-11-08T23:30:30.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2026-02-03T01:21:11.000Z (4 months ago)
- Last Synced: 2026-02-03T15:34:23.525Z (4 months ago)
- Topics: cdk8s, chart, email, kubernetes, kubernetes-deployment, mail
- Language: TypeScript
- Homepage: https://bluedynamics.github.io/cdk8s-mailu/
- Size: 1.42 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# cdk8s-mailu
CDK8S construct library for deploying Mailu mail server to Kubernetes

[](LICENSE)
π **[Full Documentation](https://bluedynamics.github.io/cdk8s-mailu/)** | [Quick Start](#quick-start) | [Architecture](https://bluedynamics.github.io/cdk8s-mailu/explanation/architecture.html)
## Overview
`cdk8s-mailu` is a [CDK8S](https://cdk8s.io/) construct library that provides a **type-safe, production-grade** way to deploy [Mailu](https://mailu.io/) mail server to Kubernetes. Generate complete Kubernetes manifests from TypeScript code with compile-time validation and IDE autocomplete.
## Why cdk8s-mailu?
- **Type-Safe Configuration** - Catch errors at compile time, not deploy time
- **Production-Grade Defaults** - Resource limits and storage sizes based on real deployments
- **Modular Architecture** - Enable/disable components with simple flags
- **Dedicated Dovecot Submission Service** - Solves webmail email sending with clean architecture
- **Well-Documented** - Comprehensive documentation following DiΓ‘taxis framework
- **Battle-Tested** - Production deployment at kup6s.com with AMD64/ARM64 mixed nodes
**[See Complete Architecture β](https://bluedynamics.github.io/cdk8s-mailu/explanation/architecture.html)**
## Installation
```bash
npm install cdk8s-mailu
# or
yarn add cdk8s-mailu
```
**Prerequisites**: Kubernetes 1.28+, PostgreSQL, Redis, Node.js 18+
**[Full Prerequisites β](https://bluedynamics.github.io/cdk8s-mailu/tutorials/01-quick-start.html#prerequisites)**
## Quick Start
Create `mailu.ts`:
```typescript
import { App } from 'cdk8s';
import { MailuChart } from 'cdk8s-mailu';
const app = new App();
new MailuChart(app, 'mailu', {
namespace: 'mailu',
domain: 'example.com',
hostnames: ['mail.example.com'],
subnet: '10.42.0.0/16', // Your Kubernetes pod CIDR
timezone: 'UTC',
database: {
type: 'postgresql',
postgresql: {
host: 'postgres-rw',
port: 5432,
database: 'mailu',
secretName: 'postgres-app',
secretKeys: {
username: 'username',
password: 'password',
},
},
},
redis: {
host: 'redis',
port: 6379,
},
secrets: {
mailuSecretKey: 'mailu-secrets',
initialAdminPassword: 'mailu-secrets',
},
components: {
webmail: true, // Roundcube webmail
clamav: false, // Antivirus (requires ~1GB RAM)
},
storage: {
storageClass: 'longhorn',
dovecot: { size: '50Gi' }, // Mailbox storage
},
// Optional: Traefik ingress (requires Traefik installed)
ingress: {
enabled: true,
type: 'traefik',
traefik: {
hostname: 'mail.example.com',
certIssuer: 'letsencrypt-cluster-issuer',
enableTcp: true, // SMTP/IMAP/POP3 routes
},
},
});
app.synth();
```
Generate and deploy:
```bash
npx ts-node mailu.ts
kubectl apply -f dist/mailu.k8s.yaml
```
**[Complete Tutorial with Secrets & DNS β](https://bluedynamics.github.io/cdk8s-mailu/tutorials/01-quick-start.html)**
## Documentation
Comprehensive documentation following the [DiΓ‘taxis](https://diataxis.fr/) framework:
### **[π Tutorials](https://bluedynamics.github.io/cdk8s-mailu/tutorials/)** - Learn by doing
- [Quick Start: Deploy Your First Instance](https://bluedynamics.github.io/cdk8s-mailu/tutorials/01-quick-start.html)
### **[π§ How-To Guides](https://bluedynamics.github.io/cdk8s-mailu/how-to/)** - Practical solutions
- Configure components
- Customize resources
- Set up TLS termination
### **[π‘ Explanation](https://bluedynamics.github.io/cdk8s-mailu/explanation/)** - Understanding the design
- [Architecture Overview](https://bluedynamics.github.io/cdk8s-mailu/explanation/architecture.html) - Component relationships and CDK8S patterns
- [Dovecot Submission Service](https://bluedynamics.github.io/cdk8s-mailu/explanation/dovecot-submission.html) - How webmail email sending works
- [CDK8S Patterns](https://bluedynamics.github.io/cdk8s-mailu/explanation/cdk8s-patterns.html) - Construct design patterns
### **[π Reference](https://bluedynamics.github.io/cdk8s-mailu/reference/)** - Technical specifications
- Configuration API reference
- Component options
- Resource defaults
## Development
```bash
npm run build # Compile + test + synth
npm run test # Run tests (>96% coverage)
npm run synth # Generate manifests only
```
## Contributing
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
## License
Apache License 2.0 - see [LICENSE](LICENSE) file for details.
## Acknowledgments
- [Mailu](https://mailu.io/) - The mail server software
- [CDK8S](https://cdk8s.io/) - Cloud Development Kit for Kubernetes
---
**[π Full Documentation](https://bluedynamics.github.io/cdk8s-mailu/) | [π Quick Start](https://bluedynamics.github.io/cdk8s-mailu/tutorials/01-quick-start.html) | [ποΈ Architecture](https://bluedynamics.github.io/cdk8s-mailu/explanation/architecture.html)**