Skip to content

romdum/k8S-scalable-wordpress-mysql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Scalable Wordpress / Mysql

Wordpress and Mysql high availability on Kubernetes.

Installation

Change the domain url in k8s/ingress.yml.

Change variables in k8s/database.env by yours and build with kustomize :

kustomize build k8s > k8s.yml

Then create a namespace and deploy :

kubectl create ns wordpress-ha
kubectl -n wordpress-ha apply -f k8s.yml

Architecture

Architecture Schema

There is 2 statefulset for MySql :

  • First is Master, which has one replica
  • Second is Slave, which has N replica

There is 2 deployment for Wordpress :

  • A backend, which has one replica (or more but it's probably useless), and is connect to MySql master to read / write data.
  • A frontend, which has N replica, and is connect to MySql slave to read data (it can't write).

If URL begins by /wp-admin or /wp-login the reverse proxy redirect to wordpress backend, else it redirect to frontend.

Increase pods number

# Increase number of database
kubectl scale -n wordpress-ha --replicas=3 statefulset/database-slave

# Increase number of wordpress
kubectl scale -n wordpress-ha --replicas=3 deployment/wordpress-frontend

References

Mysql replication inspired by Kublr article.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published