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.yaml
so that there would be podwordpress
withdatabase
container that listens on port3306
. Password and other parameters should be hardcoded in manifest. - Run
app
container with Wordpress in the same pod: Updatewordpress_manifest.yaml
so that there would be podwordpress
with additionalapp
container that listens on port80
and 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.yaml
so that there would be poddatabase
withmysql
container that works on port3306
. Password and other parameters should be hardcoded in manifest. - Check that
database
pod is running. - Run pod with Wordpress: Update
wordpress.yaml
so that there would be podwordpress
withapp
container that works on port80
. Password and other parameters should be hardcoded in manifest. Usedatabase
pod’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
app
container with newly built image. - Run Init container
plugin-download
that downloads plugin: Beforeapp
container started we need to have thank-after-post-plugin to be downloaded byplugin-download
container and later to be mounted inapp
container. Please updatewordpress.yaml
file for this task.
5. Make your work visible.
Create Pull Request with changes on files:
wordpress_manifest.yaml
database.yaml
wordpress.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