Kubernetes hands-on

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.

  1. 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 ...

Get Containers in OpenStack now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.