Why a multi-zone cluster?
GKE has multiple zones within each region, when we set up a cluster by default all the nodes get deployed in a single zone. Though rare, GCP data centres of a zone may face an outage, which might cause a business disruption lasting for a few minutes or for hours so in order to increase resiliency we can deploy the nodes of a cluster in different zones of a region. To know about setting up multi-zone cluster you can follow Google Cloud Docs.
But there are certain limitations with GKE multi-zone cluster as well,
- When a node goes down a new node will come up automatically (if autoscaling is enabled), but the problem lies with data availability in case of the attached disk is ephemeral. When a node goes down the data associated with the node is lost.
- Secondly, even if your application is capable of performing replication of data on its own, it will be more time consuming thereby resulting in a negative impact on the performance.
Hence, in any of the cases, it is advisable to provision OpenEBS volumes.
How is replication Done with OpenEBS?
OpenEBS needs a minimum of 3 replicas to run the OpenEBS cluster with high availability. If a node fails, OpenEBS will manage the data to be replicated to a new disk. In the meantime, your workload can access data from one of the replicas thereby ensuring better performance and no downtime.
Getting started with OpenEBS Enterprise Platform is simple all you need is to follow the below-mentioned steps.
Getting Started with OpenEBS Enterprise Platform
Install OpenEBS on your cluster using the following command:
kubectl apply -f https://openebs.github.io/charts/openebs-operator-1.5.0.yaml
In order to verify whether the namespace is created and all pods are working as expected, run the following command:
kubectl get ns
The OpenEBS namespace should be in Active State. ( By default pods are created in OpenEBS namespace)
NAME STATUS AGE
default Active 8m
kube-public Active 8m
kube-system Active 8m
openebs Active 11s
Run the following command to check all OpenEBS pods are in running state using the following command: By default OpenEBS pods are created in
kubectl get pod -n openebs
NAME READY STATUS RESTARTS AGE IP NODE maya-apiserver-7867696cb4-56jrw 1/1 Running 2 38m 100.96.3.2 ip-10-5-66-142.us-east-2.compute.internal openebs-admission-server-6ffc599f77-vnsvh 1/1 Running 0 38m 100.96.3.3 ip-10-5-66-142.us-east-2.compute.internal openebs-localpv-provisioner-59796cd78-jwt9t 1/1 Running 0 38m 100.96.2.3 ip-10-5-55-83.us-east-2.compute.internal openebs-ndm-5wsk9 1/1 Running 0 38m 10.5.113.122 ip-10-5-113-122.us-east-2.compute.internal openebs-ndm-gm7j7 1/1 Running 0 38m 10.5.66.142 ip-10-5-66-142.us-east-2.compute.internal openebs-ndm-l2l8x 1/1 Running 0 38m 10.5.55.83 ip-10-5-55-83.us-east-2.compute.internal openebs-ndm-operator-548c4b9d87-gmt9x 1/1 Running 1 38m 100.96.2.2 ip-10-5-55-83.us-east-2.compute.internal openebs-ndm-xn2cq 1/1 Running 0 38m 10.5.51.65 ip-10-5-51-65.us-east-2.compute.internal openebs-provisioner-744b56bd77-p5vpj 1/1 Running 0 38m 100.96.4.2 ip-10-5-51-65.us-east-2.compute.internal openebs-snapshot-operator-69658bd85b-7dxvn 2/2 Running 0 38m 100.96.4.3 ip-10-5-51-65.us-east-2.compute.internal
Creating and Attaching Disks
Next, you need to create disk and attach them to the desired VMs, this can be done either from the console or using command line arguments.
In order to get the detailed steps to create and attach disks in GCP click the corresponding link.
Provisioning OpenEBS volumes
Next, you have to provision OpenEBS volumes (cStor or Jiva or Local PV). Going through the following links can help you decide as to which will be best suited for your scenario.
Click here to know about cStor.
Click here to know about Jiva.
Click here to know about Local PV.
Provisioning an application.
Now, things are all set to deploy an application and get started.
You can refer to the below sample articles for provisioning an application.
1. Sample application for cStor.
2. Sample application for Jiva.
3. Sample application for Local PV.
Backing up Application
It is extremely important to have a data backup and restore mechanism so that the service continues flawlessly in every situation.
Monitoring of stateful applications and OpenEBS volumes
Once the entire thing is set up, volumes are provisioned, the application is deployed it is necessary to monitor these components continuously. Director provides easy and efficient monitoring. To know about how to monitor, different monitoring views click here.
OpenEBS volumes can be deployed on various other Kubernetes Platform as well, to know about it Click Here.
This article gives you an overview of multi-zone clusters in GKE and deploying of OpenEBS volumes on these clusters. Multi-zone cluster with OpenEBS volumes(cStor or Jiva) provisioned on it ensures data availability and high resiliency to failures at all times.