In this video you will see step-by-step how to deploy a WordPress instance on K8s cluster. I decided not to use any tutorial, or ‘existing yaml file’. Instead, I’m going to build my YAML definitions from scratch, using only examples from official kubernetes.io docs.
WordPress is a stateful application and requires both: file storage to store html, config, templates etc., and database.
In this particular approach I will use:
– Google Cloud SQL for MySQL instance
– PersistentVolumeClaim with Google Cloud Persistent Disk for file storage.
Before this video starts, I already prepared:
1) Kubernetes cluster, using Google Kubernetes Engine. If you need help with that step, check out my quickstart:
2) CloudSQL instance to use that as my MySQL instance. Creating an instance is really simple, couple of clicks. You can also check the official google cloud quickstart for that:
In 2:44 I’m referring to this video: (I explain in that one how to create persistent storage and show you that on example).
Even though I haven’t published my YAML definitions, if you want to see an example of such deployment, you can check out a similar one in official kubernetes.io tutorial:
The YAML definition:
PS. This is my second version of that video. In previous one (“hidden”) I followed one of the tutorials, but I decided it would be a more valuable to show you how to create such “long-and-scary” YAML definition by yourself, using both “dry-run” option and examples from official docs.
Hope you like it 🙂