This repo contains examples showing how to run MySQL in the following environments:
- in a container launched directly from docker (see the mysql readme)
- via an openshift/kubernetes pod (examples 2 and 3)
- via an openshift application template (example 4)
- via the official openshift/mysql image, which differs in user ID from the docker mysql image, such that some security settings can be explored.
We'll use both local OSE-node storage and ceph-rbd block storage under an ext4 file system to persist the database.
The next few sections are common across almost all of the examples and are also shown below:
The enviromnent used for all of the examples in this repo is described here.
The steps needed to setup a simple OSE cluster with 1 master and 1 worker node are described here.
Most of the examples use ceph-rbd within a single container (AIO, all-in-one container), and the steps needed to setup ceph are described here.
Follow the instructions here to initialize and validate containerized mysql.
- mysql + local/host storage - mysql database lives on the OSE host where the pod is scheduled
- mysql + ceph plugin - mysql database resides in ceph, a rbd plugin is specfied
- mysql + ceph + pvc - mysql database resides in ceph, a Persistent Volume (PV) and Persistent Volume Claim (PVC) are used
- mysql + ceph + template -- same as the above example except the pod and pvc are defined in a single template file
- openshift/mysql + ceph + pvc -- same as example 3 except that we're using openshift/mysql which, due to the UID being set to 27 in the image, presents some unique challenges.