WordPress + MariaDB stack running in k3s — previously used to serve
mortylabs.comandandrewmorty.com. No longer actively deployed but retained as a reference for running WordPress on Kubernetes.
⚠️ Not currently deployed — retained as a reference implementation. The Morty Labs website has since migrated to a Hugo static site on k3s.
| File | Description |
|---|---|
pv_mariadb.yaml |
PersistentVolume + PVC for MariaDB (NFS-backed, 500M) |
pv_wordpress.yaml |
PersistentVolume + PVC for WordPress (NFS-backed, 300M) |
secrets.yaml |
MariaDB root password — |
svc_maria.yaml |
ClusterIP service for MariaDB (internal only) |
svc_wordpress.yaml |
ClusterIP service for WordPress frontend |
deployment_maria.yaml |
MariaDB deployment with resource limits |
deployment_wordpress.yaml |
WordPress deployment with liveness/readiness probes |
ingress.yaml |
Ingress — multi-domain TLS via cert-manager |
Install k3s, MetalLB, ingress-nginx, and NFS provisioner first — see the root README.
1. Create the namespace:
kubectl create namespace wordpress2. Edit pv_mariadb.yaml and pv_wordpress.yaml — set your NFS server IP and paths.
3. Edit secrets.yaml — set a strong password and add to .gitignore:
echo "**/secrets.yaml" >> ../../.gitignore4. Edit ingress.yaml — replace mortylabs.com and andrewmorty.com with your domains.
kubectl create namespace wordpress
kubectl apply -f pv_mariadb.yaml
kubectl apply -f pv_wordpress.yaml
kubectl apply -f secrets.yaml
kubectl apply -f svc_maria.yaml
kubectl apply -f svc_wordpress.yaml
kubectl apply -f deployment_maria.yaml
kubectl apply -f deployment_wordpress.yaml
kubectl apply -f ingress.yaml
kubectl rollout status deploy/wordpress-mariadb -n wordpress
kubectl rollout status deploy/wordpress -n wordpress# Pods running?
kubectl get pods -n wordpress
# Services up?
kubectl get svc -n wordpress
# TLS certificate issued?
kubectl get certificate -n wordpress
# Site reachable?
curl -I https://mortylabs.com- WordPress and MariaDB run in a dedicated
wordpressnamespace - MariaDB is ClusterIP only — not exposed outside the cluster
- Resource limits set on both deployments — important on a Pi 4 with limited RAM
- Liveness/readiness probes on
/wp-login.php— gives WordPress time to start (60s delay) strategy: Recreateon both deployments — avoids two instances trying to write to the same NFS volume simultaneouslyrestartPolicyremoved from both Deployments — only valid on bare Pods