KubeKanvas Logo
  • Features
  • Pricing
  • Templates
    • How KubeKanvas works
    • Docs
    • Downloads
    • Blog
    • E-Book
    • Tutorials
  • FAQs
  • Contact
  • Features
  • Pricing
  • Templates
    • How KubeKanvas works
    • Docs
    • Downloads
    • Blog
    • E-Book
    • Tutorials
  • FAQs
  • Contact
Back to Templates

Deploying Your Production Blog - Next.js, Strapi, Database and ConfigMaps

Tags:
strapipostgresqlhorizontalpodscaling
Created by:
Mahmood
Deploying Your Production Blog - Next.js, Strapi, Database and ConfigMaps   template preview
200 uses
KubeKanvas Logo
Visual Kubernetes cluster design tool that helps you create, manage, and deploy your applications with ease.
Product
  • Features
  • Pricing
  • Templates
Resources
  • Blog
  • Tutorials
Company
  • About Us
  • Contact
  • Terms of Service
  • Privacy Policy
  • Impressum
XGitHubLinkedIn
© 2026 KubeKanvas. All rights reserved.

A production-ready Strapi and Next.js deployment on Kubernetes needs a persistent database, externalized configuration, automated TLS, horizontal autoscaling, and scheduled backups. This template wires all of that together using a PostgreSQL StatefulSet, Kubernetes Secrets and ConfigMaps, a Let's Encrypt ClusterIssuer, a Horizontal Pod Autoscaler, and a daily backup CronJob in a single deployable manifest.

What's Included

ComponentTypePortRole
PostgreSQLStatefulSet + Headless Service5432Primary database with 10Gi storage, health probes, and memory limits
Media StoragePersistentVolumeClaim-10Gi volume for Strapi media uploads
Backup StoragePersistentVolumeClaim-20Gi volume for database backup files
ConfigMapConfigMap-Non-sensitive environment configuration for Strapi and Next.js
SecretsSecret-Base64-encoded credentials for database and application
ClusterIssuerClusterIssuer-Automated Let's Encrypt TLS certificate provisioning
IngressIngress443HTTPS termination and path-based routing
Horizontal Pod AutoscalerHorizontalPodAutoscaler-Scales pods at 70% CPU and 80% memory thresholds
Backup CronJobCronJob-Daily PostgreSQL backup at 2 AM with gzip compression and 7-day retention

Architecture Overview

PostgreSQL runs as a StatefulSet with a headless Service for stable DNS and dedicated PVCs for data, media, and backups. Strapi reads non-sensitive settings from a ConfigMap and receives credentials via Kubernetes Secrets at pod startup. An NGINX Ingress with Let's Encrypt TLS handles external traffic. The HPA scales Strapi replicas when CPU exceeds 70% or memory exceeds 80%. A CronJob runs daily at 2 AM to produce gzip-compressed PostgreSQL backups with 7-day retention.

Prerequisites

  • Kubernetes cluster (cloud-managed or self-hosted)
  • NGINX Ingress Controller installed
  • cert-manager installed and configured for Let's Encrypt
  • A domain name pointed at your cluster's ingress IP
  • KubeKanvas CLI installed and running on your computer (Optional, if you want to use one-click deployment)

How to Deploy

  1. Click on the button at the top right corner of this page to load the manifest into the editor.
  2. Update the Secret component with your PostgreSQL credentials and Strapi application secrets.
  3. Edit the ConfigMap with your environment-specific Strapi and Next.js configuration values.
  4. Set your email address in the ClusterIssuer for Let's Encrypt certificate registration.
  5. Deploy the template to your cluster via the Play button in the top right bar. If you prefer to deploy manually, download the YAML and apply it with kubectl.
  6. Wait for all pods to reach Running status. You can monitor progress in the Release Monitor screen.

How to Test

  1. Verify PostgreSQL is running and all PVCs are bound, check release monitor screen or run command: kubectl get pods,pvc -n <namespace>.
  2. Open https://<your-domain>/admin and confirm the Strapi admin panel loads over HTTPS.
  3. Check the HPA is active and reporting metrics.
  4. Confirm the backup CronJob is registered.

Use Cases

  • Graduated production deployment: Moving a Strapi and Next.js blog from a dev cluster to production with a persistent database, TLS, and autoscaling.
  • Variable-traffic content sites: Deployments that need replica counts to increase automatically based on CPU and memory usage.
  • Credential-isolated configuration: Projects that require all sensitive values stored in Kubernetes Secrets rather than embedded in manifests or images.
  • Scheduled backup setups: Workloads that need daily automated database backups with retention rotation without external tooling.

Summary

This template configures the full production stack for a Strapi and Next.js blog on Kubernetes, from a PostgreSQL StatefulSet with automated backups to HTTPS and horizontal autoscaling. For a full walkthrough, read Building and Deploying a Modern Blog Platform with Next.js, Strapi, and Kubernetes: Part 3.