Step 2 - Deployment of the Rook operator for Ceph storage

Rook is an Incubating Project of the [Cloud Native Computing Foundation (CNCF)](https://cncf.io). It’s dedicated to the storage orchestration and allows to deploy several storage solutions right within a Kubernetes cluster. In this article we will focus on the Ceph storage, but other storage solutions are available.

Note: Ceph and EdgeFS are currently the 2 storage providers supported by Rook in the Stable status. Other storage providers such as Cassandra, Minio, NFS, CockroachDB, YugabyteDB are in Alpha status

First, we clone the GitHub repository and use the Release 1.2 (last release to date)



$ cd rook

$ git checkout release-1.2 $ git clone https://github.com/rook/rook.git $ cd rook$ git checkout release-1.2

For each storage solution supported by Rook, there is a Kubernetes Operator. In a nutshell an Operator is a process, running in a Pod, that contains all the logic to manage a complex application. Operators are often used to manage stateful applications.

First, we will go in the folder containing all the resources needed by Ceph.

$ cd cluster/examples/kubernetes/ceph

Next we deploy all the resources needed by the Rook’s Ceph operator.

$ kubectl create -f common.yaml

Those resources are mainly CustomRessourceDefinitions, also known as CRDs. They are used to define new resources (read resources that do not exist by default in Kubernetes) which will be used by the Operator. The other resources created are mainly linked to the access rights so the Operator can communicate with the cluster’s API Server:

ServiceAccount

Role

RoleBinding

ClusterRole

ClusterRoleBinding

Next we deploy the Ceph operator that will be in charge of the setup and of the orchestration of a Ceph cluster.

$ kubectl create -f operator.yaml

It takes a couple of seconds for the operator to be up and running. Its status can be verified with the following command.

$ kubectl get pod -n rook-ceph

Once the operator is ready, it triggers the creation of a DaemonSet in charge of deploying a rook-discover agent on each worker node of the Kubernetes cluster.

Finally, once everything is setup the result of the above command is similar to the following output.

NAME READY STATUS RESTARTS AGE

rook-ceph-operator-75d95cb868-s7m5z 1/1 Running 0 78s

rook-discover-44dq9 1/1 Running 0 43s

rook-discover-7gxn7 1/1 Running 0 43s

rook-discover-xfqmk 1/1 Running 0 43s

Note: the identifier will be different in your environment

Everything is now ready to deploy a Ceph cluster using the operator.