Chapter 3: Introduction to Kubernetes
Activity 3: Installing a WordPress Blog and Database on Kubernetes
Solution:
Perform the following steps to complete this activity:
- Create a two-container stateful set definition inside the
wordpress-database.yamlfile with the following specifications:The nme should be
wordpress-databaseand the replica count should be set to1. The database container should have the name ofdatabaseand use the container image ofmysql:5.7. Publish the container to port3306and mount thedatavolume to the/var/lib/mysqlpath. In addition, set the following environment variables:Figure 3.24: Environment variables
Create a blog container with the name
blogusing thelatestWordPress container image and publish the container to port80. In addition, set the following environment variables:Figure 3.25: Environment variables
Include a volume claim with the name
dataand1GBstorage.The stateful set description as YAML for the specification is as follows...