This template covers essential Kubernetes YAML manifests for a production-ready Strapi + Next.js blog platform. It's the ultimate guide for a production Kubernetes setup.
Key Components for Your Next.js Kubernetes Deployment
- PostgreSQL StatefulSet: Provides a stable Kubernetes database with 10Gi persistent storage, health probes, and resource limits (256Mi-512Mi memory).
- Services: Headless service for StatefulSet identity management + ClusterIP for application access.
- Configuration: A Kubernetes ConfigMap stores non-sensitive data (host, port), and a Secret manages credentials securely with base64 encoding.
- Storage: Volume claim templates for the PostgreSQL database, a 10Gi PVC for media uploads, and 20Gi for backups.
- Security: Let's Encrypt ClusterIssuer automates TLS certificates, while Ingress handles HTTPS termination and routing for a secure Strapi deployment.
- Scaling: HPA auto-scales based on CPU (70%) and memory (80%) utilization with proper resource requests/limits.
- Backups: A CronJob performs daily PostgreSQL backups at 2 AM with 7-day retention and gzip compression.
