2018-01-12 16:55:23 -08:00
---
2018-07-13 14:29:57 -06:00
title : Ceph Storage
2019-02-04 09:46:00 -08:00
weight : 300
2018-07-13 14:29:57 -06:00
indent : true
2018-01-12 16:55:23 -08:00
---
2019-12-07 11:19:29 +05:30
{% include_relative branch.liquid %}
2018-01-12 16:55:23 -08:00
2018-07-13 14:29:57 -06:00
# Ceph Storage Quickstart
2018-01-12 16:55:23 -08:00
2018-07-13 14:29:57 -06:00
This guide will walk you through the basic setup of a Ceph cluster and enable you to consume block, object, and file storage
2018-04-01 18:31:47 +02:00
from other pods running in your cluster.
2018-01-12 16:55:23 -08:00
## Minimum Version
2018-12-19 23:42:01 -07:00
Kubernetes **v1.10** or higher is supported by Rook.
2018-01-12 16:55:23 -08:00
## Prerequisites
To make sure you have a Kubernetes cluster that is ready for `Rook` , you can [follow these instructions ](k8s-pre-reqs.md ).
If you are using `dataDirHostPath` to persist rook data on kubernetes hosts, make sure your host has at least 5GB of space available on the specified path.
2018-01-19 16:36:27 -08:00
## TL;DR
2018-01-12 16:55:23 -08:00
2019-03-17 07:22:06 -06:00
If you're feeling lucky, a simple Rook cluster can be created with the following kubectl commands and [example yaml files ](https://github.com/rook/rook/blob/{{ branchName }}/cluster/examples/kubernetes/ceph ). For the more detailed install, skip to the next section to [deploy the Rook operator ](#deploy-the-rook-operator ).
2019-10-24 10:22:08 +02:00
```console
2019-12-10 20:22:56 +05:30
git clone --single-branch --branch {{ branchName }} https://github.com/rook/rook.git
2018-05-18 14:28:05 -07:00
cd cluster/examples/kubernetes/ceph
2019-03-17 07:22:06 -06:00
kubectl create -f common.yaml
2018-05-18 14:28:05 -07:00
kubectl create -f operator.yaml
2020-01-13 16:58:51 +01:00
kubectl create -f cluster.yaml
2018-01-19 16:36:27 -08:00
```
After the cluster is running, you can create [block, object, or file ](#storage ) storage to be consumed by other applications in your cluster.
2019-05-30 13:31:09 -06:00
### Production Environments
For production environments it is required to have local storage devices attached to your nodes.
2020-01-13 16:58:51 +01:00
In this walk-through, the requirement of local storage devices is relaxed so you can get a cluster up and running
as a "test" environment to experiment with Rook. See the [Ceph examples ](ceph-examples.md ) for more details.
2019-05-30 13:31:09 -06:00
2018-01-19 16:36:27 -08:00
## Deploy the Rook Operator
2019-08-01 16:31:50 -06:00
The first step is to deploy the Rook operator. Check that you are using the [example yaml files ](https://github.com/rook/rook/blob/{{ branchName }}/cluster/examples/kubernetes/ceph ) that correspond to your release of Rook. For more options, see the [examples documentation ](ceph-examples.md ).
2018-01-12 16:55:23 -08:00
2019-10-24 10:22:08 +02:00
```console
2018-05-18 14:28:05 -07:00
cd cluster/examples/kubernetes/ceph
2019-03-17 07:22:06 -06:00
kubectl create -f common.yaml
2018-05-18 14:28:05 -07:00
kubectl create -f operator.yaml
2018-01-12 16:55:23 -08:00
2019-10-24 10:22:08 +02:00
# # verify the rook-ceph-operator is in the `Running` state before proceeding
2019-03-17 07:22:06 -06:00
kubectl -n rook-ceph get pod
2018-01-12 16:55:23 -08:00
```
2018-01-19 16:36:27 -08:00
You can also deploy the operator with the [Rook Helm Chart ](helm-operator.md ).
2019-03-17 07:22:06 -06:00
## Create a Rook Ceph Cluster
2018-01-19 16:36:27 -08:00
2019-08-01 16:31:50 -06:00
Now that the Rook operator is running we can create the Ceph cluster. For the cluster to survive reboots,
2018-12-03 23:48:40 -07:00
make sure you set the `dataDirHostPath` property that is valid for your hosts. For more settings, see the documentation on [configuring the cluster ](ceph-cluster-crd.md ).
2018-01-12 16:55:23 -08:00
Create the cluster:
2019-10-24 10:22:08 +02:00
```console
2020-01-13 16:58:51 +01:00
kubectl create -f cluster.yaml
2018-01-12 16:55:23 -08:00
```
2019-02-05 17:02:58 -05:00
Use `kubectl` to list pods in the `rook-ceph` namespace. You should be able to see the following pods once they are all running.
2020-01-13 16:58:51 +01:00
The number of osd pods will depend on the number of nodes in the cluster and the number of devices configured.
If you did not modify the `cluster.yaml` above, it is expected that one OSD will be created per node.
2019-08-01 16:31:50 -06:00
The `rook-ceph-agent` and `rook-discover` pods are also optional depending on your settings.
2018-01-12 16:55:23 -08:00
2019-10-24 10:22:08 +02:00
```console
2018-05-18 14:28:05 -07:00
$ kubectl -n rook-ceph get pod
2019-03-17 07:22:06 -06:00
NAME READY STATUS RESTARTS AGE
rook-ceph-agent-4zkg8 1/1 Running 0 140s
rook-ceph-mgr-a-d9dcf5748-5s9ft 1/1 Running 0 77s
rook-ceph-mon-a-7d8f675889-nw5pl 1/1 Running 0 105s
rook-ceph-mon-b-856fdd5cb9-5h2qk 1/1 Running 0 94s
rook-ceph-mon-c-57545897fc-j576h 1/1 Running 0 85s
rook-ceph-operator-6c49994c4f-9csfz 1/1 Running 0 141s
2019-05-30 13:31:09 -06:00
rook-ceph-osd-0-7cbbbf749f-j8fsd 1/1 Running 0 23s
rook-ceph-osd-1-7f67f9646d-44p7v 1/1 Running 0 24s
2019-03-17 07:22:06 -06:00
rook-ceph-osd-2-6cd4b776ff-v4d68 1/1 Running 0 25s
2019-05-30 13:31:09 -06:00
rook-ceph-osd-prepare-node1-vx2rz 0/2 Completed 0 60s
rook-ceph-osd-prepare-node2-ab3fd 0/2 Completed 0 60s
rook-ceph-osd-prepare-node3-w4xyz 0/2 Completed 0 60s
2019-03-17 07:22:06 -06:00
rook-discover-dhkb8 1/1 Running 0 140s
2018-01-12 16:55:23 -08:00
```
2019-05-30 13:31:09 -06:00
To verify that the cluster is in a healthy state, connect to the [Rook toolbox ](ceph-toolbox.md ) and run the
`ceph status` command.
2019-10-24 10:22:08 +02:00
* All mons should be in quorum
* A mgr should be active
* At least one OSD should be active
* If the health is not `HEALTH_OK` , the warnings or errors should be investigated
```console
2019-05-30 13:31:09 -06:00
$ ceph status
cluster:
id: a0452c76-30d9-4c1a-a948-5d8405f19a7c
health: HEALTH_OK
services:
mon: 3 daemons, quorum a,b,c (age 3m)
mgr: a(active, since 2m)
osd: 3 osds: 3 up (since 1m), 3 in (since 1m)
...
```
If the cluster is not healthy, please refer to the [Ceph common issues ](ceph-common-issues.md ) for more details and potential solutions.
2019-10-24 10:22:08 +02:00
## Storage
2018-01-12 16:55:23 -08:00
For a walkthrough of the three types of storage exposed by Rook, see the guides for:
2019-10-24 10:22:08 +02:00
* **[Block ](ceph-block.md )**: Create block storage to be consumed by a pod
* **[Object ](ceph-object.md )**: Create an object store that is accessible inside or outside the Kubernetes cluster
* **[Shared Filesystem ](ceph-filesystem.md )**: Create a filesystem to be shared across multiple pods
## Ceph Dashboard
2018-06-07 15:08:58 -07:00
Ceph has a dashboard in which you can view the status of your cluster. Please see the [dashboard guide ](ceph-dashboard.md ) for more details.
2019-10-24 10:22:08 +02:00
## Tools
2018-01-12 16:55:23 -08:00
2018-12-08 08:07:03 -07:00
We have created a toolbox container that contains the full suite of Ceph clients for debugging and troubleshooting your Rook cluster. Please see the [toolbox readme ](ceph-toolbox.md ) for setup and usage information. Also see our [advanced configuration ](advanced-configuration.md ) document for helpful maintenance and tuning examples.
2018-01-12 16:55:23 -08:00
2019-10-24 10:22:08 +02:00
## Monitoring
2018-01-12 16:55:23 -08:00
Each Rook cluster has some built in metrics collectors/exporters for monitoring with [Prometheus ](https://prometheus.io/ ).
2018-12-07 12:42:04 +01:00
To learn how to set up monitoring for your Rook cluster, you can follow the steps in the [monitoring guide ](./ceph-monitoring.md ).
2018-01-12 16:55:23 -08:00
2019-10-24 10:22:08 +02:00
## Teardown
2018-01-12 16:55:23 -08:00
2018-07-13 14:29:57 -06:00
When you are done with the test cluster, see [these instructions ](ceph-teardown.md ) to clean up the cluster.