O'Reilly logo

Containers in OpenStack by Madhuri Kumari, Pradeep Kumar Singh

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required