Using Rook-Ceph for Persistent Storage in On-Prem Kubernetes Clusters

Rook-Ceph persistent storage for on-prem Kubernetes

Deploy resilient, scalable on-prem Kubernetes storage using Rook-Ceph. Learn architecture, setup steps, best practices, and examples for block, file, and object storage.

Table of Contents

🔈Introduction

Organizations running Kubernetes on-premises often discover that managing persistent storage is harder than deploying applications themselves. Public cloud platforms provide turnkey block and file storage services, but baremetal and private datacenter environments usually require administrators to build and maintain their own storage layer. This challenge grows as clusters scale, stateful workloads multiply, and reliability expectations rise.

Rook-Ceph has emerged as one of the most reliable and production-proven ways to provide persistent, distributed, self-healing storage for Kubernetes—without forcing teams to run a separate storage platform outside the cluster. This post offers a thorough, practical introduction to deploying Rook-Ceph for on-prem Kubernetes clusters, covering the architecture, benefits, deployment choices, real-world tips, and example commands. It is written for platform engineers, DevOps practitioners, SREs, and anyone building resilient storage for Kubernetes.


✅ Why Rook-Ceph?

Rook is an open-source storage orchestrator for Kubernetes. Ceph is a mature, battle-tested distributed storage system trusted in environments ranging from hyperscale data centers to edge clusters. Paired together, they deliver a storage solution that is:

  • Integrated: Ceph clusters are deployed, operated, and healed by Kubernetes operators.
  • Flexible: Provides block, shared file, and object storage through one backend.
  • Scalable: Capacity and performance grow simply by adding more nodes or disks.
  • Self-healing: Data is replicated and automatically rebalanced across nodes.
  • Hardware-agnostic: Works on commodity servers, NVMe, SSD, HDD, or mixed pools.
  • Resilient: Designed for fault tolerance across disks, nodes, and even racks.

For on-prem clusters where cloud-native storage is unavailable, Rook-Ceph is one of the few fully open-source solutions that delivers enterprise-level functionality with community-driven transparency.


🔥Core Components of a Rook-Ceph Cluster

Understanding the architecture helps teams plan, troubleshoot, and optimize storage layouts.

🔄 Ceph Monitor (MON)

MONs maintain cluster maps and quorum. A healthy cluster requires at least three MONs for high availability.

🔄 Ceph Manager (MGR)

Managers provide monitoring, statistics, and the web dashboard. At least two instances are recommended.

🔄 Object Storage Daemons (OSDs)

OSDs store the actual data. Each disk or storage device maps to one OSD. These are the backbone of capacity and throughput.

🔄 Placement Groups (PGs)

PGs distribute and balance data across OSDs. Ceph automatically manages this, but capacity planning must consider PG count.

🔄 Ceph Block Pool / CephFS / RGW

These provide the different storage types Rook exposes to Kubernetes:

Storage ModeCeph ComponentUses
Block Storage (RBD)Ceph Block PoolDatabases, key–value stores, apps needing PVCs
Shared File StorageCephFSWeb servers, shared workloads, CI caches
Object StorageRGW (Rados Gateway)S3-compatible backups, archives, application buckets

🔥When to Use Rook-Ceph in On-Prem Clusters

Rook-Ceph fits well when:

  • You want dynamic provisioning, not manual NFS exports or iSCSI targets.
  • You need scalable multi-protocol support from one backend.
  • You prefer vendor-neutral and open-source control over storage.
  • You operate multi-node bare-metal clusters and want unified storage across them.

Rook-Ceph is not ideal if:

  • You run single-node clusters (replication requires multiple nodes).
  • You lack dedicated storage devices (loopback / host-path is discouraged for production).
  • You require external storage appliances (then use CSI drivers instead).

📦 Planning Your Storage Layout

A successful deployment begins with understanding how you want storage distributed across nodes.

🔄 Hardware Considerations

ComponentRecommendation
CPU≥4 cores per storage node
RAM≥16 GB; more for CephFS metadata workloads
OSModern Linux distribution with LVM2 and necessary kernel modules
DisksSSD or NVMe for metadata; HDD acceptable for bulk capacity pools
NetworkDedicated 10GbE or faster for storage replication

Use homogeneous disks when possible for predictable performance but mixed pools are acceptable with proper tiers.


📤 Installing Rook-Ceph on Kubernetes

Below is a streamlined but production-friendly installation workflow.

🔄 Deploy the Rook Operator

				
					git clone --depth 1 https://github.com/rook/rook.git
				
			
				
					cd rook/deploy/examples
				
			
				
					kubectl apply -f crds.yaml -f common.yaml -f operator.yaml
				
			

Verify that the operator is running:

				
					kubectl -n rook-ceph get pods
				
			

🔄 Create a Cluster Custom Resource

The cluster.yaml defines how Ceph is deployed. A minimal example:

				
					apiVersion: ceph.rook.io/v1
kind: CephCluster
metadata:
  name: rook-ceph
  namespace: rook-ceph
spec:
  cephVersion:
    image: quay.io/ceph/ceph:v18
  dataDirHostPath: /var/lib/rook
  mon:
    count: 3
    allowMultiplePerNode: false
  storage:
    useAllNodes: true
    useAllDevices: true
    config:
      osdsPerDevice: "1"
				
			

Apply it:

				
					kubectl apply -f cluster.yaml
				
			

🔄 Validate the Ceph Cluster

Check cluster health:

				
					kubectl -n rook-ceph exec deploy/rook-ceph-tools -- ceph status
				
			
				
					kubectl -n rook-ceph exec deploy/rook-ceph-tools -- ceph osd tree
				
			

You should see a HEALTH_OK or at minimum HEALTH_WARN (acceptable during PG backfilling).


🔧 Provisioning Storage for Kubernetes

📦 Block Storage

Block storage is the most common use case.

🔄 Create a CephBlockPool:

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

Apply:

				
					kubectl apply -f blockpool.yaml
				
			

🔄 Create a StorageClass:

				
					apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: rook-ceph-block
provisioner: rook-ceph.rbd.csi.ceph.com
parameters:
  pool: replicapool
  imageFormat: "2"
  clusterID: rook-ceph
reclaimPolicy: Delete
allowVolumeExpansion: true
				
			

Use it in a PVC:

				
					apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pgdata
spec:
  accessModes: [ "ReadWriteOnce" ]
  storageClassName: rook-ceph-block
  resources:
    requests:
      storage: 20Gi
				
			

📦 Shared File Storage (CephFS)

CephFS enables multi-write workloads with shared POSIX semantics. Create a filesystem:

				
					apiVersion: ceph.rook.io/v1
kind: CephFilesystem
metadata:
  name: cephfs
  namespace: rook-ceph
spec:
  metadataPool:
    replicated:
      size: 3
  dataPools:
    - replicated:
        size: 3
				
			

Create a StorageClass:

				
					apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: rook-cephfs
provisioner: rook-ceph.cephfs.csi.ceph.com
parameters:
  fsName: cephfs
				
			

📦 Object Storage (S3-Compatible)

Rook can expose S3 via the Ceph RGW gateway.

				
					apiVersion: ceph.rook.io/v1
kind: CephObjectStore
metadata:
  name: rook-s3
  namespace: rook-ceph
spec:
  gateway:
    port: 80
  zone:
    name: zone1
				
			

This is useful for backup tools (Velero), artifact storage, and internal application buckets.


🔥Operational Best Practices

Running Ceph in production is powerful but requires thoughtful operation. These practices help maintain a healthy cluster.

🔄 Spread Storage Across Failure Domains

Use failureDomain: host or rack to ensure replicas are placed safely.

🔄 Monitor Cluster Health Regularly

Set up metrics and alerts:

  • ceph status
  • ✅ Prometheus Ceph exporter
  • ✅ Grafana Ceph dashboards
  • ✅ Alert rules for OSD down, PG stuck, MON quorum issues

🔄 Use Separate Networks If Possible

Ceph supports:

  • Public network for client traffic
  • Cluster network for OSD replication

Segregation lowers latency spikes and prevents noisy neighbors.

🔄 Avoid Overfilling

Ceph performance degrades severely above 80% capacity. Automate alerts and cleanups well before reaching this threshold.

🔄 Prefer Bluestore on Raw Devices

Bluestore offers better performance and efficiency compared to filestore, especially on NVMe.

🔄 Plan for Scaling

Adding nodes is straightforward, but shrinking clusters is more complex and time-consuming due to data migration. Plan cluster growth before workloads demand it.

🔄 Back Up Critical Metadata

Export Ceph configs and keyrings for disaster recovery:

				
					ceph auth list > ceph-keys-backup.txt
				
			
				
					ceph config dump > ceph-config-backup.txt
				
			

🖥️ Example: Deploying PostgreSQL with Rook-Ceph

Once storage is configured, using it inside applications becomes trivial.

				
					apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: postgres-data
spec:
  storageClassName: rook-ceph-block
  accessModes: ["ReadWriteOnce"]
  resources:
    requests:
      storage: 50Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: postgres
spec:
  replicas: 1
  selector:
    matchLabels:
      app: postgres
  template:
    metadata:
      labels:
        app: postgres
    spec:
      containers:
        - name: postgres
          image: postgres:16
          env:
            - name: POSTGRES_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: postgres-secret
                  key: password
          volumeMounts:
            - mountPath: /var/lib/postgresql/data
              name: data
      volumes:
        - name: data
          persistentVolumeClaim:
            claimName: postgres-data
				
			

Because the PVC uses Rook-Ceph, this database pod now benefits from replicated, resilient, dynamically provisioned storage.


▶️ Comparing Rook-Ceph with Other On-Prem Storage Options

FeatureRook-CephNFSLonghornOpenEBSProprietary SAN
ReplicationYesNoYesYes (varies)Yes
Self-healingYesLimitedYesVariesYes
Block storageYesNoYesYesYes
File storageYesYesLimitedLimitedYes
Object storageYesNoNoNoAdd-on
ScalabilityHighMediumMediumMediumHigh
CostFreeFreeFreeFreeHigh
Operational complexityModerateLowLowMediumLow

Rook-Ceph offers the richest set of capabilities but requires administrators comfortable with distributed storage concepts.


🧰 Troubleshooting Common Issues

🔧 Cluster reports HEALTH_WARN due to slow OSDs

  • 🛠️ Ensure enough CPU and RAM per node.
  • 🛠️ Confirm disks aren’t failing.
  • 🛠️ Check that your network bandwidth is adequate.

🔧 Too few MONs / lost quorum

Restart MON pods:

				
					kubectl -n rook-ceph delete pod -l app=rook-ceph-mon
				
			

Make sure your nodes have stable network connectivity and time synchronization.

🔧 PVC stuck in “Pending”

Check the CSI driver:

				
					kubectl get pods -n rook-ceph | grep csi
				
			

Check StorageClass correctness:

				
					kubectl describe storageclass rook-ceph-block
				
			

🔧 PGs stuck in “activating / recovering”

  • 🛠️ Add more OSDs.
  • 🛠️ Ensure no disk or node is overloaded.
  • 🛠️ Run:
				
					ceph pg repair <pg-id>
				
			

🚀 Scaling and Upgrades

Ceph and Rook support seamless incremental upgrades.

🔧 Upgrade Rook

				
					kubectl apply -f operator.yaml
				
			

🔧 Upgrade Ceph

Update the image in the CephCluster spec:

				
					cephVersion:
  image: quay.io/ceph/ceph:v18.2.1
				
			

Ceph performs rolling upgrades of MONs, MGRs, and OSDs with minimal disruption.

🔧 Adding New Storage Nodes

  • 🛠️ Add node to Kubernetes cluster.
  • 🛠️ Confirm label (if using node selectors).
  • 🛠️ Ensure disks are visible.
  • 🛠️ Rook automatically detects new devices if useAllDevices: true is configured.

🏁 Conclusion

Rook-Ceph is one of the most complete, flexible, and production-ready storage solutions for on-prem Kubernetes clusters. It brings the power of Ceph’s distributed architecture directly into Kubernetes, enabling teams to provide block, file, and object storage with a unified, self-healing, scalable system.

From stateful applications to CI platforms, analytics clusters, and internal developer tooling, organizations that need resilient storage without relying on external appliances can gain enormous value from Rook-Ceph. With thoughtful planning, strong observability, and adherence to best practices, it delivers cloud-like storage capabilities using your own hardware, fully under your control.

Did you find this article helpful? Your feedback is invaluable to us! Feel free to share this post with those who may benefit, and let us know your thoughts in the comments section below.


📕 Related Posts
Install KVM on Fedora 41
Commands
Install KVM on Fedora 41

Learn how to install KVM on Fedora 41 step-by-step—covering prerequisites, CLI & GUI configuration, networking, performance tuning, and best practices for virtualized environments. Table of

Read More »

Leave a Reply

Logged in as admingeek. Edit your profile. Log out? Required fields are marked *