Task 02. Run blog engine on k8s. Pods.
You started learning Kubernetes from the Pods. So your first idea was to run “Video Games Magazine” inside those pods.
Task
1. Repository
- Fork repository for task02 and clone forked repo.
2. Run local WordPress setup in single pod.

- Run pod with MySQL database: Update
wordpress_manifest.yamlso that there would be podwordpresswithdatabasecontainer that listens on port3306. Password and other parameters should be hardcoded in manifest. - Run
appcontainer with Wordpress in the same pod: Updatewordpress_manifest.yamlso that there would be podwordpresswith additionalappcontainer that listens on port80and accessing database by addresslocalhost:3306. Password and other parameters should be hardcoded in manifest. - Check that wordpress pod is running.
3. Run local WordPress setup in multiple pods.

- Run pod with MySQL database: Update
database.yamlso that there would be poddatabasewithmysqlcontainer that works on port3306. Password and other parameters should be hardcoded in manifest. - Check that
databasepod is running. - Run pod with Wordpress: Update
wordpress.yamlso that there would be podwordpresswithappcontainer that works on port80. Password and other parameters should be hardcoded in manifest. Usedatabasepod’s hostname as your database. - Check that wordpress pod is running.
4. Run Init container inside WordPress pod.

- Build container with wordpress that doens’t have plugin built it.
- Replace container image from
appcontainer with newly built image. - Run Init container
plugin-downloadthat downloads plugin: Beforeappcontainer started we need to have thank-after-post-plugin to be downloaded byplugin-downloadcontainer and later to be mounted inappcontainer. Please updatewordpress.yamlfile for this task.
5. Make your work visible.
Create Pull Request with changes on files:
wordpress_manifest.yamldatabase.yamlwordpress.yaml
6. Cleanup created resources
Additional tasks if you feel that it was too easy.
- Resources and limits: Before running any container it’s always nice to limit it’s resources usage so that it doesn’t allocate all of them. Try to use it.
- Kubernetes has mechanism to check whether container is ready to handle traffick, it’s called
readinessProbe. Try to use it. - Kubernetes has mechanism to check whether container is ready to handle traffick, it’s called
livenessProbe. Try to use it.
Tips:
- Try to find info, how to get pod’s hostname
Recommended soft:
- N/A
Useful links:
FAQ
- N/A