Galera Cluster with Rook-Ceph in Kubernetes

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: mysql-datadir-galera-ss-0
spec:
storageClassName: rook-ceph-block
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: mysql-datadir-galera-ss-1
spec:
storageClassName: rook-ceph-block
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: mysql-datadir-galera-ss-2
spec:
storageClassName: rook-ceph-block
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
mysql-datadir-galera-ss-0                 Bound     pvc-b3ae532e-317f-4d74-b63c-c04885ef6c8d   10Gi       RWO            rook-ceph-block   12d
mysql-datadir-galera-ss-1 Bound pvc-7861469f-b56f-42f8-8b20-7ca26b5aedf4 10Gi RWO rook-ceph-block 12d
mysql-datadir-galera-ss-2 Bound pvc-cce0477e-11ca-4d9f-8ceb-8653fb2fb05d 10Gi RWO rook-ceph-block 12d
core@alex-k8s-1 ~ $ kubectl get pvc -n rook-ceph
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
galera-pv-claim Bound pvc-b1092630-a7ea-440d-83af-31bcdf815daa 20Gi RWO rook-ceph-block 12d
pvc-7861469f-b56f-42f8-8b20-7ca26b5aedf4   10Gi       RWO            Delete           Bound    default/mysql-datadir-galera-ss-1   rook-ceph-block            12dpvc-b3ae532e-317f-4d74-b63c-c04885ef6c8d   10Gi       RWO            Delete           Bound    default/mysql-datadir-galera-ss-0   rook-ceph-block            12dpvc-cce0477e-11ca-4d9f-8ceb-8653fb2fb05d   10Gi       RWO            Delete           Bound    default/mysql-datadir-galera-ss-2   rook-ceph-block            12d
core@alex-k8s-1 ~/charts/stable/prometheus $ cat ~/storageclass.yaml 
apiVersion: ceph.rook.io/v1
kind: CephBlockPool
metadata:
name: replicapool
namespace: rook-ceph
spec:
failureDomain: host
replicated:
size: 3
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: rook-ceph-block
# Change "rook-ceph" provisioner prefix to match the operator namespace if needed
provisioner: rook-ceph.rbd.csi.ceph.com
parameters:
# clusterID is the namespace where the rook cluster is running
clusterID: rook-ceph
# Ceph pool into which the RBD image shall be created
pool: replicapool
# RBD image format. Defaults to "2".
imageFormat: "2"
# RBD image features. Available for imageFormat: "2". CSI RBD currently supports only `layering` feature.
imageFeatures: layering
# The secrets contain Ceph admin credentials.
csi.storage.k8s.io/provisioner-secret-name: rook-ceph-csi
csi.storage.k8s.io/provisioner-secret-namespace: rook-ceph
csi.storage.k8s.io/node-stage-secret-name: rook-ceph-csi
csi.storage.k8s.io/node-stage-secret-namespace: rook-ceph
# Specify the filesystem type of the volume. If not specified, csi-provisioner
# will set default as `ext4`.
csi.storage.k8s.io/fstype: xfs
# Delete the rbd volume when a PVC is deleted
reclaimPolicy: Delete

--

--

SW Architect/programmer- in various languages and technologies from 2001 to now. https://www.linkedin.com/in/alexpunnen/

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store