Skip to content

// diagrams › kubernetes

WordPress and MySQL on Kubernetes with persistent volumes

The official WordPress and MySQL tutorial on Kubernetes, drawn object by object: Deployments, Services, PersistentVolumeClaims and a Secret, then what to change before real visitors arrive.

Opens a copy in the editor, in a new tab, ready to change. No account needed.

WordPress on Kubernetes architecture diagram: a LoadBalancer Service sends visitors to a WordPress pod, which reaches a MySQL pod through the headless wordpress-mysql Service; both pods read a mysql-pass Secret and mount 20Gi ReadWriteOnce PersistentVolumeClaims provisioned by the default StorageClass.

What’s in this diagram

services and parts

  • Visitors
  • mysql-pass Secret (kustomize secretGenerator)
  • wordpress-mysql Deployment (Recreate)
  • wordpress Service (LoadBalancer, port 80)
  • wordpress Deployment (Recreate)
  • WordPress pod (wordpress:6.2.1-apache)
  • wordpress-mysql Service (headless, 3306)
  • MySQL pod (mysql:8.0)
  • wp-pv-claim (20Gi, ReadWriteOnce)
  • Default StorageClass
  • mysql-pv-claim (20Gi, ReadWriteOnce)

groups

  • Kubernetes cluster
  • Namespace

Key points

  • Two Deployments, two Services, two PersistentVolumeClaims and one Secret make the whole application.
  • WordPress finds MySQL by the Service's name, not by a pod address.
  • Each volume is ReadWriteOnce, so each Deployment can run only one pod: this design cannot scale out as drawn.
  • For production, the tutorial itself points to a packaged Helm chart; we also suggest a managed database.

The whole story, step by step: WordPress on Kubernetes: from tutorial to production.

Your diagram is one sentence away.

Start drawing, free

No account needed to start.