Deploy Mayastor

Overview

In this Quickstart guide we demonstrate deploying Mayastor by using the Kubernetes manifest files provided within the deployfolder of the Mayastor project's GitHub repository. The repository is configured for the GitFlow release pattern, wherein the master branch contains official releases. By extension, the head of the master branch represents the latest official release.
The steps and commands which follow are intended only for use with, and tested against, the latest release. Earlier releases or development versions may require a modified or different installation process.

Create Mayastor Application Resources

Namespace

Command (GitHub Latest)
1
kubectl create namespace mayastor
Copied!

RBAC Resources

Command (GitHub Latest)
Expected Output
1
kubectl create -f https://raw.githubusercontent.com/openebs/Mayastor/master/deploy/moac-rbac.yaml
Copied!
1
serviceaccount/moac created
2
clusterrole.rbac.authorization.k8s.io/moac created
3
clusterrolebinding.rbac.authorization.k8s.io/moac created
Copied!

Custom Resource Definitions

Command (GitHub Latest)
1
kubectl apply -f https://raw.githubusercontent.com/openebs/Mayastor/master/csi/moac/crds/mayastorpool.yaml
Copied!

Deploy Mayastor Dependencies

NATS

Mayastor uses NATS, an Open Source messaging system, as an event bus for some aspects of control plane operations, such as registering Mayastor nodes with MOAC (Mayastor's primary control plane component).
Command (GitHub Latest)
1
kubectl apply -f https://raw.githubusercontent.com/openebs/Mayastor/master/deploy/nats-deployment.yaml
Copied!
Verify that the deployment of the NATS application to the cluster was successful. Within the mayastor namespace there should be a single pod having a name starting with "nats-", and with a reported status of Running.
Command
Example Output
1
kubectl -n mayastor get pods --selector=app=nats
Copied!
1
NAME READY STATUS RESTARTS AGE
2
nats-b4cbb6c96-nbp75 1/1 Running 0 28s
Copied!

etcd

Mayastor uses etcd, a distributed, reliable key-value store, to persist runtime configuration. The steps described below deploy a limited etcd cluster instance which can be used in conjunction with Mayastor for the purposes of this quickstart guide's testing scenarios.
By default, the example given does not perisist the etcd data on stable storage.
The etcd cluster deployed here is intended for demonstration purposes only. By default, this instance does not perisist the etcd data on stable storage. For production use, the user is responsible for the deployment of a suitable etcd instance which they have verifed satisfies their use case, and recommended best practices for etcd.
Command (GitHub Latest)
1
kubectl apply -f https://raw.githubusercontent.com/openebs/Mayastor/master/deploy/etcd/statefulset.yaml
2
kubectl apply -f https://raw.githubusercontent.com/openebs/Mayastor/master/deploy/etcd/svc.yaml
3
kubectl apply -f https://raw.githubusercontent.com/openebs/Mayastor/master/deploy/etcd/svc-headless.yaml
Copied!
Verify that the deployment of etcd to the cluster was successful. Within the mayastor namespace there should be 3 pods having a name starting with "mayastor-etcd-", and with a reported status of "Running".
Command
Example Output
1
kubectl -n mayastor get pods --selector=app.kubernetes.io/name=etcd
Copied!
1
NAME READY STATUS RESTARTS AGE
2
mayastor-etcd-0 1/1 Running 0 24m
3
mayastor-etcd-1 1/1 Running 0 24m
4
mayastor-etcd-2 1/1 Running 0 24m
Copied!

Deploy Mayastor Components

CSI Node Plugin

Command (GitHub Latest)
1
kubectl apply -f https://raw.githubusercontent.com/openebs/Mayastor/master/deploy/csi-daemonset.yaml
Copied!
Verify that the CSI Node Plugin DaemonSet has been correctly deployed to all worker nodes in the cluster.
Command
Example Output
1
kubectl -n mayastor get daemonset mayastor-csi
Copied!
1
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
2
mayastor-csi 3 3 3 3 3 kubernetes.io/arch=amd64 26m
Copied!

Control Plane

Command (GitHub Latest)
1
kubectl apply -f https://raw.githubusercontent.com/openebs/Mayastor/master/deploy/moac-deployment.yaml
Copied!
Verify that the MOAC control plane pod is running.
Command
Example Output
1
kubectl get pods -n mayastor --selector=app=moac
Copied!
1
NAME READY STATUS RESTARTS AGE
2
moac-7d487fd5b5-9hj62 3/3 Running 0 8m4s
Copied!

Data Plane

Command (GitHub Latest)
1
kubectl apply -f https://raw.githubusercontent.com/openebs/Mayastor/master/deploy/mayastor-daemonset.yaml
Copied!
Verify that the Mayastor DaemonSet has been correctly deployed. The reported Desired, Ready and Available instance counts should be equal, and should match the count of worker nodes which carry the label openebs.io/engine=mayastor (as performed earlier in the "Preparing the Cluster" stage).
Command
Example Output
1
kubectl -n mayastor get daemonset mayastor
Copied!
1
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
2
mayastor 3 3 3 3 3 kubernetes.io/arch=amd64,openebs.io/engine=mayastor 108s
Copied!
For each resulting Mayastor pod instance, a Mayastor Node (MSN) custom resource definition should be created. List these definitions and verify that the count meets the expected number and that all nodes are reporting their State as online
Command
Example Output
1
kubectl -n mayastor get msn
Copied!
1
NAME STATE AGE
2
aks-agentpool-12194210-0 online 8m18s
3
aks-agentpool-12194210-1 online 8m19s
4
aks-agentpool-12194210-2 online 8m15s
Copied!
Last modified 3mo ago