We learned how to install the Kubernetes cluster in the previous section. Now, let's create a more complex example with Kubernetes. In this application, we will deploy an application running a WordPress site and MySQL database using official Docker images.
- Create a persistent volume. Both WordPress and MySQL will use this volume to store data. We will create two local persistent volumes of size 5 GB each. Copy the following content to the volumes.yaml file:
apiVersion: v1 kind: PersistentVolume metadata: name: pv-1 labels: type: local spec: capacity: storage: 5Gi accessModes: - ReadWriteOnce hostPath: path: /tmp/data/pv-1 storageClassName: slow --- apiVersion: v1 kind: PersistentVolume metadata: name: pv-2 ...