Open ajeshbaby opened 4 years ago
Have 5 workloads running on the same.
Kafka deployment.
Used KUDO operator to deploy kaka and zookeeper instances. Those resources are deployed under kafka-hostpath
namespace. These instances consume OpenEBS LocalPV based on hostpath for persistent storage.
Commands used to install those resources are
- kubectl kudo install -n kafka-hostpath zookeeper --instance=zookeeper-instance -p STORAGE_CLASS=kafka-hostpath -p DISK_SIZE=50Gi
- kubectl kudo install -n kafka-hostpath kafka --instance=kafka -p STORAGE_CLASS=kafka-hostpath -p DISK_SIZE=300Gi
Resources created:
k8s@k8s-master:~$ kubectl get all -n kafka-hostpath
NAME READY STATUS RESTARTS AGE
pod/kafka-kafka-0 2/2 Running 0 4m1s
pod/kafka-kafka-1 2/2 Running 0 2m59s
pod/kafka-kafka-2 2/2 Running 0 2m12s
pod/zookeeper-instance-zookeeper-0 1/1 Running 0 2d16h
pod/zookeeper-instance-zookeeper-1 1/1 Running 0 2d17h
pod/zookeeper-instance-zookeeper-2 1/1 Running 0 2d17h
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kafka-svc ClusterIP None <none> 9093/TCP,9092/TCP,9094/TCP,9096/TCP 4m1s
service/zookeeper-instance-cs ClusterIP 10.110.97.231 <none> 2181/TCP 2d17h
service/zookeeper-instance-hs ClusterIP None <none> 2888/TCP,3888/TCP 2d17h
NAME READY AGE
statefulset.apps/kafka-kafka 3/3 4m1s
statefulset.apps/zookeeper-instance-zookeeper 3/3 2d17h
k8s@k8s-master:~$ kubectl get pvc -n kafka-hostpath
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
kafka-datadir-kafka-kafka-0 Bound pvc-6ead874b-a6de-470e-a472-718e4c15eda6 300Gi RWO kafka-hostpath 25m
kafka-datadir-kafka-kafka-1 Bound pvc-fca7fa11-fdab-43c7-979c-ea643283ebd4 300Gi RWO kafka-hostpath 24m
kafka-datadir-kafka-kafka-2 Bound pvc-f472594f-3dce-44e5-a113-e5059a6fdbf0 300Gi RWO kafka-hostpath 24m
zookeeper-instance-datadir-zookeeper-instance-zookeeper-0 Bound pvc-50242a29-6e30-45c8-8887-181eadb717d4 50Gi RWO kafka-hostpath 2d17h
zookeeper-instance-datadir-zookeeper-instance-zookeeper-1 Bound pvc-9fccde4b-b881-4dea-967b-f3784b921723 50Gi RWO kafka-hostpath 2d17h
zookeeper-instance-datadir-zookeeper-instance-zookeeper-2 Bound pvc-60d1707a-f420-4cee-a616-860938768905 50Gi RWO kafka-hostpath 2d17h
Percona deployment
Percona is deployed in such a way to consume OpenEBS persistent volume based on Jiva storage engine. It is deployed under the namespace app-percona-jiva
A new jiva storage pool was created for this workload.
k8s@k8s-master:~/oep/mysql$ kubectl get sp
NAME AGE
workload-jiva-pool 28d
The resources created are as follows:
k8s@k8s-master:~$ kubectl get all -n app-percona-jiva
NAME READY STATUS RESTARTS AGE
pod/percona-586b9fcbc4-vhkb2 0/1 CrashLoopBackOff 5 5m2s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/percona-mysql ClusterIP 10.100.203.254 <none> 3306/TCP 27d
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/percona 0/1 1 0 27d
NAME DESIRED CURRENT READY AGE
replicaset.apps/percona-586b9fcbc4 1 1 0 27d
k8s@k8s-master:~$ kubectl get pvc -n app-percona-jiva
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
percona-mysql-claim Bound pvc-ba2652c5-5df0-4297-b9ab-240f57f9cd47 200Gi RWO workload-jiva-3rep 27d
Cassandra deployment
Cassandra statefulset is deployed using KUDO operator. It is designed in such a way to consume OpenEBS localpv based on selected block devices.
Labeled a set of block devices with label openebs.io/block-device-tag=cassandra
and created a storage class specifying BlockDeviceTag
with this label as follows:
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: openebs-device-cassandra
annotations:
openebs.io/cas-type: local
cas.openebs.io/config: |
- name: StorageType
value: "device"
- name: BlockDeviceTag
value: "cassandra"
provisioner: openebs.io/local
volumeBindingMode: WaitForFirstConsumer
reclaimPolicy: Delete
The resources created are as follows:
k8s@k8s-master:~/oep/cassandra$ kubectl get all -n cassandra-localpv
NAME READY STATUS RESTARTS AGE
pod/cassandra-node-0 1/1 Running 0 25m
pod/cassandra-node-1 1/1 Running 0 22m
pod/cassandra-node-2 0/1 Init:0/1 0 10m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/cassandra-svc ClusterIP 10.110.56.1 <none> 7000/TCP,7001/TCP,9042/TCP 54m
NAME READY AGE
statefulset.apps/cassandra-node 2/3 54m
k8s@k8s-master:~/oep/cassandra$ kubectl get pvc -n cassandra-localpv
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
var-lib-cassandra-cassandra-node-0 Bound pvc-1a375a09-c75a-4d80-b1ac-5455fbe48fd1 20Gi RWO openebs-device-cassandra 41m
var-lib-cassandra-cassandra-node-1 Bound pvc-f4c08f49-bdb3-43b8-900f-219b8e1a65df 20Gi RWO openebs-device-cassandra 23m
var-lib-cassandra-cassandra-node-2 Bound pvc-7ec71317-da82-43db-8600-6c5fa0d2dd25 20Gi RWO openebs-device-cassandra 10m
MySQL Deployment
MySQL application consumes a storage volume based on cstor with three replicas. Created a storage pool of raid type mirror which is described below.
k8s@k8s-master:~/cstor/postgres$ kubectl get cspc,cspi -n openebs
NAME HEALTHYINSTANCES PROVISIONEDINSTANCES DESIREDINSTANCES AGE
cstorpoolcluster.cstor.openebs.io/cspc-mirror-pool 3 3 3 107m
NAME HOSTNAME ALLOCATED FREE CAPACITY READONLY TYPE STATUS AGE
cstorpoolinstance.cstor.openebs.io/cspc-mirror-pool-8l9b k8s-worker8 6380k 248G 248G false mirror ONLINE 106m
cstorpoolinstance.cstor.openebs.io/cspc-mirror-pool-nng9 k8s-worker9 6280k 248G 248G false mirror ONLINE 106m
cstorpoolinstance.cstor.openebs.io/cspc-mirror-pool-wdbs k8s-worker7 6290k 248G 248G false mirror ONLINE 106m
Created a storage class csi-cstor-3rep
pointing to the above storage pool.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: csi-cstor-3rep
provisioner: cstor.csi.openebs.io
allowVolumeExpansion: true
parameters:
cas-type: cstor
cstorPoolCluster: cspc-mirror-pool
replicaCount: "3"
Installed MySQL deployment mounted with OpenEBS cStor PVC. The resources created under the namespace mysql-cstor
are as follows:
k8s@k8s-master:~/cstor/storageclass$ kubectl get all -n mysql-cstor
NAME READY STATUS RESTARTS AGE
pod/mysql-5456cbb767-zpq4p 1/1 Running 0 90m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/mysql ClusterIP None <none> 3306/TCP 90m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/mysql 1/1 1 1 90m
NAME DESIRED CURRENT READY AGE
replicaset.apps/mysql-5456cbb767 1 1 1 90m
k8s@k8s-master:~/cstor/storageclass$ kubectl get pvc -n mysql-cstor
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
mysql-pv-claim Bound pvc-4d22ac2c-6d59-4d6c-815d-a8d2610b8501 200Gi RWO csi-cstor-3rep 90m
Postgress deployment Postgress application is deployed in such a way to consume a storage volume based on cstor with three replicas for its data operations. The storage volume is created out of above cstor pool. The resources created under postgress-cstor namespace are as follows:
k8s@k8s-master:~/cstor/storageclass$ kubectl get all -n postgress-cstor
NAME READY STATUS RESTARTS AGE
pod/postgres-5cf47489b4-zb89v 1/1 Running 0 2m23s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/postgres 1/1 1 1 33m
NAME DESIRED CURRENT READY AGE
replicaset.apps/postgres-5cf47489b4 1 1 1 33m
k8s@k8s-master:~/cstor/storageclass$ kubectl get pvc -n postgress-cstor
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
postgres-data Bound pvc-0b94bcb9-dee4-4bcc-86b3-57f18c337479 100Gi RWO csi-cstor-3rep 33m
k8s@k8s-master:~/cstor/storageclass$ kubectl get cvr -n openebs | grep pvc-0b94bcb9-dee4-4bcc-86b3-57f18c337479
pvc-0b94bcb9-dee4-4bcc-86b3-57f18c337479-cspc-mirror-pool-8l9b 19.0M 3.06M Healthy 33m
pvc-0b94bcb9-dee4-4bcc-86b3-57f18c337479-cspc-mirror-pool-nng9 30.3M 6.91M Healthy 33m
pvc-0b94bcb9-dee4-4bcc-86b3-57f18c337479-cspc-mirror-pool-wdbs 31.1M 7.25M Healthy 33m
Openebs components are upgraded to 1.10.0-ee-RC3 images.