In this recipe, we will deploy Wordpress using dynamic persistent volumes created by the Rook Ceph block storage provider. Let's perform the following steps:
- Clone the examples repository:
$ git clone https://github.com/k8sdevopscookbook/src.git
$ cd src/chapter5/rook/
- Review both mysql.yaml and wordpress.yaml. Note that PVCs are using the rook-ceph-block storage class:
$ cat mysql.yaml && cat wordpress.yaml
- Deploy MySQL and WordPress:
$ kubectl apply -f mysql.yaml
$ kubectl apply -f wordpress.yaml
- Confirm the persistent volumes created:
$ kubectl get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pvc-eb2d23b8-d38a-11e9-88a2-a2c82783dcda 20Gi RWO Delete Bound default/mysql-pv-claim rook-ceph-block 38s
pvc-eeab1ebc-d38a-11e9-88a2-a2c82783dcda 20Gi RWO Delete Bound default/wp-pv-claim rook-ceph-block 38s
- Get the external IP of the WordPress service:
$ kubectl get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.0.0.1 <none> 443/TCP 6h34m
wordpress LoadBalancer 10.0.102.14 13.64.96.240 80:30596/TCP 3m36s
wordpress-mysql ClusterIP None <none> 3306/TCP 3m42s
- Open the external IP of the WordPress service in your browser to access your Wordpress deployment:
Now you know how to get the popular WordPress service, with persistent storage stored on Rook-based Ceph storage, up and running.