In this lab, we will create a reasonably complex application stack on Google Kubernetes Engine, creating deployments for WordPress and MySQL and utilizing persistent disks. To complete this lab, you should have some basic experience and familiarity with Google Cloud Platform and Google Kubernetes Engine.
Learning Objectives
Successfully complete this lab by achieving the following learning objectives:
- Create the GKE Cluster and Storage Class
- Create a three-node GKE cluster using the
n1-standard-1
instance type. - Create a new storage class object to utilize SSD persistent disks. You can use the
ssd-storageclass.yaml
file in the supporting Git repo.
- Create a three-node GKE cluster using the
- Create Persistent Volumes
- Create persistent volume claims for MySQL and WordPress. You can use the
mysql-pvc.yaml
andwordpress-pvc.yaml
files in the supporting Git repo.
- Create persistent volume claims for MySQL and WordPress. You can use the
- Deploy MySQL
- Create a secret object called
mysql
to store the MySQL DB root password. If you are using themysql-secret.yaml
file in the GitHub repo, you should change the value of the password for security reasons. You will need to base64 encode a new value. - Create the MySQL deployment. You can use the
mysql-deployment.yaml
file in the GitHub repo. Create the MySQL service. You can use the
mysql-service.yaml
file in the GitHub repo.echo -n mypassword | base64 -w 0
- Create a secret object called
- Deploy WordPress
- Create the WordPress deployment. You can use the
wordpress-deployment.yaml
file in the GitHub repo. - Create the WordPress service. You can use the
wordpress-service.yaml
file in the GitHub repo.
It will take a few minutes for the GCP load balancer to assign a public IP address, after which you should be able to access the WordPress site by following the link from the Services & Ingress tab in the GKE section of the GCP console.
You should then be able to access your new installation.
Note: WordPress installations can be insecure, and you should not leave yours running for long before concluding and stopping this lab.
- Create the WordPress deployment. You can use the