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-1.3.0.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 IP NODE NOMINATED 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 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.