Why a multi-zone cluster?
AWS provides Regions and Zone to provide High Availability support for running stateful applications. AWS has multiple zones within each region. When we set up a cluster with multiple nodes, by default all the nodes get deployed in a single zone. Though rare, AWS 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.
But there are certain limitations with AWS 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. If it is a persistent disk, then disk should be attached to the new node manually.
- 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 across zones in a region. If a node fails, OpenEBS will manage the data to be replicated to a new disk(if it is an ephemeral disk), which will come up as part of ASG. In the meantime, your workload is in accessing the live data from one the replicas.
How is replication Done with OpenEBS?
OpenEBS needs a minimum of 3 replicas to run the OpenEBS cluster with high availability. OpenEBS helps to provision OpenEBS volume and manages the replication across zones.
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.yaml
In order to verify whether the namespace is created, run the following command:
kubectl get ns
The OpenEBS namespace should be in Active State.
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
openebs namespace. In this section, we are using considering
openebs as OpenEBS installed namespace.
kubectl get pod -n openebs
NAME READY STATUS RESTARTS AGE
cstor-disk-pool-7rvn-58755cd45b-qnlvx 3/3 Running 0 91s
cstor-disk-pool-f3oe-84b6b77544-gxwgg 3/3 Running 0 91s
cstor-disk-pool-z7v7-fc687b857-65j4r 3/3 Running 0 91s
openebs-admission-server-55b94dc948-2zzsw 1/1 Running 0 8m58s
openebs-apiserver-765c9d4d8d-vhncj 1/1 Running 0 8m58s
openebs-localpv-provisioner-586c564bf7-8kbcs 1/1 Running 0 8m58s
openebs-ndm-9gtb4 1/1 Running 0 8m58s
openebs-ndm-lgt7b 1/1 Running 0 8m58s
openebs-ndm-operator-d79857478-mjdsr 1/1 Running 1 8m58s
openebs-ndm-rglsq 1/1 Running 0 8m58s
openebs-provisioner-7955b7948f-hn6zb 1/1 Running 0 8m58s
openebs-snapshot-operator-d767587b-vswsl 2/2 Running 0 8m58
Creating and Attaching Disks
Next, you need to create EBS volumes 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 AWS, click the corresponding link.
Provisioning OpenEBS volumes
Next, you have to provision OpenEBS volumes (cStor or Jiva or LocalPV). Going through the following links can help you to 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 LocalPV.
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 busybox application for cStor.
2. Sample busybox application for Jiva.
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 AWS 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.