Introduction to Rook¶
Overview of Rook and its purpose¶
Rook is an open source cloud-native storage orchestrator, providing the platform, framework, and support for Ceph storage to natively integrate with cloud-native environments.
Ceph is a distributed storage system that provides file, block and object storage and is deployed in large scale production clusters.
Rook and Ceph¶
Rook simplifies the deployment of Ceph storage on Kubernetes by leveraging Kubernetes primitives. By running Ceph within the Kubernetes cluster, applications can easily access block devices and file systems managed by Rook. Additionally, Rook enables the use of the S3/Swift API for object storage.
The core component of Rook is the Rook operator, which automates the configuration and monitoring of the storage cluster. The operator, contained within a simple container, handles the initialization and monitoring of Ceph monitor pods, Ceph OSD daemons for RADOS storage, and other necessary Ceph daemons. It also manages custom resource definitions (CRDs) for pools, object stores, and file systems, ensuring the required pods and resources are provisioned.
The Rook operator continuously monitors the health of the storage daemons and takes appropriate actions to maintain cluster stability. It starts or fails over Ceph monitors as needed and makes adjustments based on the cluster's scaling. The operator also keeps an eye on desired state changes specified in the Ceph custom resources (CRs) and applies those changes accordingly.
Overall, Rook's operator streamlines the deployment and management of Ceph storage on Kubernetes, providing automated configuration, monitoring, and adjustment of the storage cluster.
Architecture¶¶
How to use it¶
Rook helps you use Ceph storage with Kubernetes by taking care of all the setup and monitoring tasks. It makes sure everything is running smoothly and adapts to changes in the storage cluster
Is time to hands dirty, Rook is available in two options:
- Helm Chart: Rook Helm charts are preconfigured templates that simplify the deployment and management of Rook within a Kubernetes cluster. Helm is a package manager for Kubernetes that allows users to define, install, and manage applications and services.
- CRDS: Rook uses CRDs (Custom Resource Definition) to define and manage storage resources such as pools, object stores, and file systems. The CRDs provide a way to define these storage-related entities and their associated properties, allowing Rook to interact with and manage them in a Kubernetes-native manner.
Requisites¶
Based on the Rook documents, if you want to start using rook, you need to have at least the following requirements
- Kubernetes Cluster: we know you probably already have a Kubernetes Cluster, but if you just want to try Rook before jump on, you can use Minikube and that is fine, of course we encourage recommended to use a real Kubernetes Cluster otherwise probably you will not be able to explore the whole capacity of the Rook
- Kubernetes version v1.22 at least is required
- CPU Architecture:
amd64 / x86_64
arm64
- To configure the Ceph storage cluster, at least one of these local storage options are required(not required by Minikube):
- Raw devices (no partitions or formatted filesystems)
- Raw partitions (no formatted filesystem)
- LVM Logical Volumes (no formatted filesystem)
- Persistent Volumes available from a storage class in block mode
Installing Rook using Helm Chart¶
The most easy way to install Rook is by using Helm chart, Helm is the package manager for Kubernetes it allows to automate the creation, packaging, configuration, and deployment of Kubernetes applications by combining your configuration files into a single reusable package, you can find more details of helm here Quickstart Guide
- First we need to add the rook repository to helm
- Clone the
values.yaml
file and replace them with the right values - Install the chart
- Finally, after some minutes you can examine your pods installed by rook helm chart by using
kubectl -n rook-ceph get pod
Installing Rook using CRDS¶
Similarly, you can install Rook by using CRDs (Custom Resource Definition)
- Clone the Rook repository
- Go the Rook examples
- Create the CRD's
- Create the cluster resource depending on the type of the cluster that you have
- cluster.yaml: Cluster settings for a production cluster running on bare metal. Requires at least three worker nodes.
- cluster-on-pvc.yaml: Cluster settings for a production cluster running in a dynamic cloud environment.
- cluster-test.yaml: Cluster settings for a test environment such as minikube.
- Finally, after some minutes you can examine your pods created by the rook CRDs by using
kubectl -n rook-ceph get pod
Now you can use Rook along with your Kubernetes Cluster which is great, in the next chapter we are going to see the benefits of use KSD Koor Storage Distribution since it has been developed on top of Rook by installing Koor you can enjoy the Rook features and some tools that improve the Rook-Ceph experience.