High-Availability WordPress Template for Deployment on Kubernetes

Running WordPress on Kubernetes with high availability requires multiple application replicas, a stable MySQL backend, session affinity, automated TLS, horizontal autoscaling, and scheduled backups. This template deploys WordPress as a 3-replica Deployment backed by a MySQL StatefulSet, with cert-manager TLS, a Horizontal Pod Autoscaler, and CronJob-based backups all preconfigured in a single manifest.
| Component | Type | Port | Role |
|---|---|---|---|
| MySQL | StatefulSet + Service | 3306 | Primary database with persistent storage and health monitoring |
| WordPress | Deployment | 80 | 3-replica application with resource limits and readiness probes |
| ConfigMap | ConfigMap | - | Non-sensitive WordPress configuration values |
| Secrets | Secret | - | WordPress authentication keys and database credentials |
| ClusterIP Service | Service | - | Internal access to WordPress pods |
| LoadBalancer Service | Service | - | External entry point for WordPress traffic |
| PersistentVolumeClaim | PersistentVolumeClaim | - | Persistent storage for WordPress files and MySQL data |
| ClusterIssuer | ClusterIssuer | - | Automated Let's Encrypt TLS certificate provisioning |
| Ingress | Ingress | 443 | HTTPS termination with session affinity routing |
| Horizontal Pod Autoscaler | HorizontalPodAutoscaler | - | Dynamic scaling based on CPU and memory metrics |
| Backup CronJob | CronJob | - | Scheduled backups for database and WordPress files |
MySQL runs as a StatefulSet with persistent storage and health probes for stable database identity across restarts. WordPress runs as a 3-replica Deployment behind ClusterIP and LoadBalancer Services with session affinity so each user consistently reaches the same pod. An NGINX Ingress handles TLS termination via Let's Encrypt. The HPA adjusts WordPress replica counts based on CPU and memory usage. CronJobs handle scheduled backups for both MySQL and the WordPress file volume.
kubectl get pods,pvc -n <namespace>.https://<your-domain>/wp-admin and verify the WordPress login screen loads over HTTPS.This template configures a 3-replica WordPress deployment on Kubernetes backed by a MySQL StatefulSet, with Let's Encrypt TLS, horizontal autoscaling, and scheduled database and file backups preconfigured. For a full walkthrough, read High-Availability WordPress Template for Deployment on Kubernetes