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.
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.
To create the stack, all you need to do is:
cd docker-compose
docker-compose up
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:
cd kubernetes
kubectl create namespace <namespace>
kubectl config set-context $(kubectl config current-context) --namespace=<namespace>
kubectl create -f set-persistence.yaml
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
kubectl create -f deployment-wordpress.yaml
kubectl expose deployment web --type=LoadBalancer
Need help implementing this?
Feel free to contact us using this form.