Skip to content

Deploy Rook-Ceph on Kubernetes for cluster storage

Install Rook-Ceph on Kubernetes so your pods get replicated block volumes and shared file volumes from the disks in your own nodes. You deploy the operator, build a three-node Ceph cluster, and prove a volume works.

Rook is a Kubernetes operator that installs and runs Ceph, a distributed storage system, inside your cluster. It suits a team whose pods need storage that survives the loss of a node, built from the spare disks in the nodes they already run. Ceph can serve block volumes for one pod, shared file volumes for many pods, and S3-compatible object storage from the same set of disks. The steps below install the Rook operator from the official manifests, create a Ceph cluster on three storage nodes, and add storage classes for block and shared file volumes. You finish with a test volume that a pod has written to and read back.

What you’ll accomplish

  • A Rook operator and a Ceph cluster running in the rook-ceph namespace, with every version pinned.
  • Three monitors, two managers and one storage daemon per disk, spread over three nodes.
  • A rook-ceph-block storage class that keeps three copies of every volume on three different nodes.
  • An optional rook-cephfs storage class for volumes that several pods mount at once.
  • A health check you can repeat at any time, and a test volume that proves provisioning works.

Prerequisites

As of November 2026, the current stable Rook release is v1.21.2, published on 5 November 2026. Rook’s documentation for that release lists these requirements:

  • Kubernetes v1.32 through v1.37, on amd64 or arm64 nodes.
  • Ceph Squid v19.2.0 or newer, or Ceph Tentacle v20.2.1 or newer. The v1.21.2 example manifests use Tentacle v20.2.4, so this article does too. Ceph Reef (v18) is no longer on the supported list.
  • At least three storage nodes, each with one or more raw disks. A raw disk has no partitions and no filesystem.
  • The rbd kernel module on every node. RBD (RADOS Block Device) is Ceph’s block volume format, and the node’s kernel maps each volume.
  • A running udev daemon on every storage node. Most distributions start one by default.
  • kubectl with cluster-admin rights, and git on your workstation.

Rook needs the LVM package (lvm2) only for encrypted disks, a separate metadata device, or more than one storage daemon per disk. This layout uses none of those, so you can skip it.

Rook also publishes Helm charts. This article uses the plain manifests, so each object you create is visible in a file.

How it works

You describe the storage you want in Kubernetes objects, and the Rook operator creates the Ceph daemons to match. The object types come from CRDs (custom resource definitions), which add new kinds such as CephCluster and CephBlockPool to the Kubernetes API.

A Ceph cluster has three kinds of daemon that matter on the first day:

  • Monitors (MON) hold the map of the cluster and vote on changes. You run three, so two can still agree when one node is down. That agreement is called quorum.
  • Managers (MGR) serve metrics and the dashboard. One is active and one stands by.
  • Object storage daemons (OSD) store the data. Each OSD owns one whole disk.

Applications reach Ceph through the CSI (Container Storage Interface) drivers, which Rook v1.21 installs with a separate CSI operator. When a pod asks for a PVC (PersistentVolumeClaim) from a Rook storage class, the driver creates an RBD image in a Ceph pool. The node then maps that image and mounts it in the pod. To the pod it is an ordinary volume.

Replication happens in the pool. A pool with size: 3 and failureDomain: host writes every object to three OSDs on three different nodes. When a node fails, the volumes stay available from the other two copies. Ceph restores the third copy when a third node is available again.

Running Ceph inside Kubernetes means the storage depends on both layers. A broken pod network or a full node disk can hurt Ceph even when Ceph itself is fine.

Step-by-step

  1. Check that each storage disk is empty. Run this on every storage node:

    lsblk -f

    Example output:

    NAME   FSTYPE LABEL UUID                                 MOUNTPOINT
    sda
    └─sda1 ext4         5d1c7a0e-93b4-4f6a-8e2b-71c0a4d9f3b6 /
    sdb

    Here sdb has an empty FSTYPE column and no partitions, so Rook can use it. If FSTYPE shows a value, Rook skips that disk. Clear it first with the wipe commands in Troubleshooting.

  2. Check the kernel module. Still on each node:

    sudo modprobe rbd

    The command prints nothing when the module loads. If it answers not found, that node’s kernel cannot map block volumes. Use a kernel or distribution that ships the rbd module.

  3. Download the manifests for the pinned release. On your workstation:

    git clone --single-branch --branch v1.21.2 https://github.com/rook/rook.git
    cd rook/deploy/examples

    Always work from a release tag. The master branch can change at any time and is not supported.

  4. Install the CRDs, the CSI operator and the Rook operator.

    kubectl create -f crds.yaml -f common.yaml -f csi-operator.yaml
    kubectl create -f operator.yaml
    kubectl -n rook-ceph rollout status deployment/rook-ceph-operator --timeout=300s

    The last command should end with deployment "rook-ceph-operator" successfully rolled out. If it times out, run kubectl -n rook-ceph describe pod -l app=rook-ceph-operator and read the events at the bottom.

  5. Write the cluster definition. Save this as cluster-prod.yaml. Replace the three node names with your own. Each name must match the node’s kubernetes.io/hostname label, which kubectl get nodes --show-labels shows. Replace sdb if your empty disk has another name.

    apiVersion: ceph.rook.io/v1
    kind: CephCluster
    metadata:
      name: rook-ceph
      namespace: rook-ceph
    spec:
      cephVersion:
        image: quay.io/ceph/ceph:v20.2.4
        allowUnsupported: false
      security:
        cephx:
          csi:
            keyType: aes
      dataDirHostPath: /var/lib/rook
      mon:
        count: 3
        allowMultiplePerNode: false
      mgr:
        count: 2
        allowMultiplePerNode: false
      dashboard:
        enabled: true
        ssl: true
      resources:
        osd:
          requests:
            cpu: "1"
            memory: "4Gi"
          limits:
            memory: "4Gi"
      storage:
        useAllNodes: false
        useAllDevices: false
        nodes:
          - name: "k8s-storage-01"
            devices:
              - name: "sdb"
          - name: "k8s-storage-02"
            devices:
              - name: "sdb"
          - name: "k8s-storage-03"
            devices:
              - name: "sdb"

    Four settings deserve a word:

    • image names one exact Ceph release. A floating tag such as v20 can leave nodes on different builds.
    • keyType: aes comes from Rook’s example file, which requires it when nodes run a Linux kernel older than 7.0.
    • allowMultiplePerNode: false forces the three monitors onto three different nodes. One node failure then costs one monitor, and quorum holds.
    • useAllDevices: false with a named list means Rook touches only the disks you wrote down. With true, Rook takes every empty disk it finds.

    The memory figure sets how much RAM each OSD may use. Rook copies it into the OSD’s own memory target. Budget 4 GiB per OSD on each storage node, on top of what your other pods need. Rook warns in the operator log when an OSD gets less than 2048 MB.

  6. Create the cluster and watch it start.

    kubectl create -f cluster-prod.yaml
    kubectl -n rook-ceph get pod --watch

    Example output after a few minutes, shortened (press Ctrl+C to stop watching):

    NAME                                                  READY   STATUS      RESTARTS   AGE
    ceph-csi-controller-manager-6c8b5d7f49-x2mvq          1/1     Running     0          9m
    rook-ceph-mgr-a-5f7c9d8b6c-tn4kz                      2/2     Running     0          3m
    rook-ceph-mgr-b-7d6b8c5f94-q8wlp                      2/2     Running     0          3m
    rook-ceph-mon-a-6b9f7d4c85-hj2rs                      1/1     Running     0          5m
    rook-ceph-mon-b-58c7d9f6b4-m6vtx                      1/1     Running     0          4m
    rook-ceph-mon-c-7f8d6c9b55-z9pkc                      1/1     Running     0          4m
    rook-ceph-operator-85f5b946bd-s8grz                   1/1     Running     0          12m
    rook-ceph-osd-0-6bb747b6c5-lnvb6                      1/1     Running     0          90s
    rook-ceph-osd-1-7f67f9646d-44p7v                      1/1     Running     0          88s
    rook-ceph-osd-2-6cd4b776ff-v4d68                      1/1     Running     0          87s
    rook-ceph-osd-prepare-k8s-storage-01-vx2rz            0/2     Completed   0          2m
    rook-ceph.rbd.csi.ceph.com-nodeplugin-cfcxr           3/3     Running     0          4m

    You need three mon pods, two mgr pods and one osd pod per disk, all Running. The osd-prepare pods end as Completed, which is normal. If no osd pod appears, go to Troubleshooting.

  7. Start the toolbox and read the cluster health. The toolbox is a pod that holds the ceph command-line client.

    kubectl create -f toolbox.yaml
    kubectl -n rook-ceph rollout status deploy/rook-ceph-tools
    kubectl -n rook-ceph exec deploy/rook-ceph-tools -- ceph status

    Example output:

      cluster:
        id:     7c41e2d8-5b90-4a36-9f1e-2d6a8c3b0e57
        health: HEALTH_OK
    
      services:
        mon: 3 daemons, quorum a,b,c (age 6m)
        mgr: a(active, since 5m), standbys: b
        osd: 3 osds: 3 up (since 2m), 3 in (since 2m)

    Check three lines. All monitors are in quorum, one manager is active, and every OSD is both up and in. HEALTH_WARN or HEALTH_ERR comes with a reason. Read it with ceph health detail in the same toolbox before you go further.

  8. Create the block pool and its storage class. Rook’s example file holds both objects:

    kubectl create -f csi/rbd/storageclass.yaml
    kubectl get storageclass rook-ceph-block

    The file creates a pool named replicapool with these settings:

    apiVersion: ceph.rook.io/v1
    kind: CephBlockPool
    metadata:
      name: replicapool
      namespace: rook-ceph
    spec:
      failureDomain: host
      replicated:
        size: 3
        requireSafeReplicaSize: true

    It also creates the rook-ceph-block storage class, with the provisioner rook-ceph.rbd.csi.ceph.com, reclaimPolicy: Delete and volume expansion allowed. The second command should list that class. Three copies on three hosts is why you need three storage nodes.

  9. Optional: add shared file volumes. CephFS is Ceph’s shared filesystem. Use it for a ReadWriteMany volume, which several pods mount at once.

    kubectl create -f filesystem.yaml
    kubectl create -f csi/cephfs/storageclass.yaml
    kubectl -n rook-ceph get pod -l app=rook-ceph-mds

    The first file creates a filesystem named myfs with three copies of its data and metadata. The second creates the rook-cephfs storage class. Wait until two rook-ceph-mds-myfs pods are Running before a workload asks for a volume. MDS is the metadata server that CephFS needs. A claim made earlier stays Pending until it is up.

  10. Open the dashboard through a port-forward. Rook creates the dashboard service inside the cluster only. Keep it that way.

    kubectl -n rook-ceph get secret rook-ceph-dashboard-password -o jsonpath="{['data']['password']}" | base64 --decode && echo
    kubectl -n rook-ceph port-forward svc/rook-ceph-mgr-dashboard 8443:8443

    The first command prints the generated password for the admin user. Then open https://localhost:8443. Your browser warns about the certificate because Rook signs it itself.

Validate it works

Create a small claim and a pod that writes to it:

cat > rook-smoke.yaml <<'EOF'
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: rook-smoke
spec:
  accessModes: [ReadWriteOnce]
  storageClassName: rook-ceph-block
  resources:
    requests:
      storage: 4Gi
---
apiVersion: v1
kind: Pod
metadata:
  name: rook-smoke-writer
spec:
  restartPolicy: Never
  containers:
    - name: writer
      image: busybox:1.36
      command: ["sh", "-c", "echo rook-ok > /data/probe && sleep 3600"]
      volumeMounts:
        - name: data
          mountPath: /data
  volumes:
    - name: data
      persistentVolumeClaim:
        claimName: rook-smoke
EOF
kubectl apply -f rook-smoke.yaml
kubectl wait --for=condition=Ready pod/rook-smoke-writer --timeout=180s
kubectl get pvc rook-smoke
kubectl exec rook-smoke-writer -- cat /data/probe

Example output of the last two commands:

NAME         STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS      AGE
rook-smoke   Bound    pvc-3f9a1c7e-64d2-4b85-a0c9-8e2f5d71b4a6   4Gi        RWO            rook-ceph-block   21s
rook-ok

Bound means Ceph created the volume. rook-ok means the pod mounted it and wrote to it. Then confirm the cluster is still healthy and remove the test:

kubectl -n rook-ceph get cephcluster rook-ceph -o jsonpath='{.status.ceph.health}{"\n"}'
kubectl delete -f rook-smoke.yaml

The first command should print HEALTH_OK. With that, you have a working Ceph cluster that provisions replicated volumes on request.

After the install

  • Snapshots are not backups. An RBD snapshot lives in the same pool as the volume, so losing the pool loses both. Copy important data out of the cluster, for example with rbd export from the toolbox.
  • Keep other workloads light on storage nodes. An OSD that runs out of memory is killed, and Ceph then spends effort recovering its data.
  • Check placement groups now and then. Ceph splits each pool into placement groups (PGs), and its autoscaler adjusts their number as the pool fills. Run ceph osd pool autoscale-status in the toolbox to see the current and target counts.
  • Check supported versions before any upgrade. Each Rook release supports a set list of Ceph versions, shown in Rook’s Ceph upgrade guide. The toolbox is not upgraded for you. Update its image to the same Ceph version by hand.

Troubleshooting

No OSD pods appear. Rook skips any disk that has partitions or a filesystem. Read the preparation log for the node:

kubectl -n rook-ceph get pod -l app=rook-ceph-osd-prepare
kubectl -n rook-ceph logs <osd-prepare-pod-name> provision

A line such as skipping device sdb that is in use means the disk is not empty. Wipe it on that node. These commands destroy everything on the disk, so check the device name twice:

DISK="/dev/sdb"
sudo sgdisk --zap-all "$DISK"
sudo blkdiscard "$DISK"   # SSDs only
sudo partprobe "$DISK"

Then restart the operator so it scans again: kubectl -n rook-ceph rollout restart deployment/rook-ceph-operator.

Monitors start, but no manager or OSD follows. The monitors cannot form quorum. After a reinstall, the usual cause is files left by the earlier install in /var/lib/rook, the dataDirHostPath folder. Delete the cluster, remove that folder on every node, wipe the OSD disks, and create the cluster again. Rook’s cleanup guide lists each step. On a first install, check that no firewall blocks ports 3300 and 6789 between nodes.

A PVC stays Pending. There are two usual causes. Either fewer OSDs are up and in than the pool’s size, or the CSI pods are not running. Check ceph status in the toolbox first. Then run kubectl -n rook-ceph get pod | grep csi and look for a pod that is not Running.

A node’s root disk fills up. Monitor data and logs live in /var/lib/rook on the host. Put that path on a filesystem with room to grow. When a node runs short of disk, Kubernetes starts evicting pods from it.

A monitor stays down after a node failure. By default the operator waits 10 minutes, then starts a replacement monitor on another node. It can only do that while the other two monitors keep quorum, so repair a second failing node quickly.

When this is the wrong approach

Rook-Ceph is heavy. It asks for three storage nodes, several gigabytes of memory per disk, and someone who can read Ceph health output. If you only need replicated block volumes on a small cluster, Longhorn or OpenEBS is easier to run. If storage must outlive the Kubernetes cluster, or serve machines outside it, run Ceph on its own hosts with cephadm. On a managed cloud Kubernetes service, the provider’s own disk storage class is usually less work. Rook’s quickstart lists other example cluster files, including one for cloud disks.

If this is the kind of work you’d rather never own again, it’s the daily job of Managed Cloud Ops — book an infrastructure review.