Skip to content

Deploy a Percona cluster behind a HA proxy to which connect 3 wordpress containers that have a HA proxy in front of them.

License

Notifications You must be signed in to change notification settings

netbears/percona-cluster-wordpress_with_HAProxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wordpress with Percona Cluster

Deploy a Percona cluster behind a Load Balancer to which multiple wordpress containers connect that have a Load Balancer in front of them.

This tutorial has been created in regards to 2 deployment methods : docker-compose and kubernetes.

Please amend the volumes path according to your OS.

Docker-Advanced presentation is available here.

Provider

The tutorial and explanation is also posted on the NETBEARS company blog. You might want to check the website out for more tutorials like this.

DOCKER COMPOSE

To create the stack, all you need to do is:

cd docker-compose
docker-compose up

KUBERNETES

This tutorial assumes that you have first performed the following steps:

  • Install Google Cloud SDK
  • Login to your existing project gcloud init
  • Install kubernetes with gcloud components install kubectl

If alerted that you need to remove existing kubectl applications, please do and:

  • Add KUBECONFIG as environment variable with value <user_home_dir>\.kube\config
  • Run gcloud auth application-default login

If everything is working, then the following should connect you to your project and get kubernetes cluster info.

gcloud container clusters get-credentials <cluster-name> --zone europe-west1-b --project <project-name>
kubectl cluster-info

Then, to create the stack, follow these instructions:

Connect to cluster

cd kubernetes
kubectl create namespace <namespace>
kubectl config set-context $(kubectl config current-context) --namespace=<namespace>

Set persistence

kubectl create -f set-persistence.yaml

Create database

kubectl create -f replica-set-db-primary.yaml
kubectl expose rs db-primary

# wait around 50 seconds
kubectl create -f replica-set-db-slave.yaml
kubectl create -f service-db-cluster.yaml
kubectl get pods,services

Create web servers

kubectl create -f deployment-wordpress.yaml
kubectl expose deployment web --type=LoadBalancer

Final notes

Need help implementing this?

Feel free to contact us using this form.

About

Deploy a Percona cluster behind a HA proxy to which connect 3 wordpress containers that have a HA proxy in front of them.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages