Interview's MateKubernetes
Interview's Mate

Kubernetes

K8s · Workloads · GitOps · Cloud

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Kubernetes topics
Lesson 69/ 160
04. Storage & Persistent Data

Distributed & Self-Hosted Storage (Rook-Ceph, Longhorn, OpenEBS)

Run software-defined storage in-cluster when cloud disks are not enough.

AdvancedRook-Ceph · Longhorn · OpenEBS3 quiz questions
Practice DevOps Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

In plain words

Distributed storage is a library storing copies of each book in several branches while an operator tracks which branch is healthy. The simple Kubernetes rule is: Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes.

Think of it like…

Distributed storage is a library storing copies of each book in several branches while an operator tracks which branch is healthy.

Where you’ve seen it

Before approving a data-path change, the storage owner runs kubectl get cephcluster,longhornreplica,openebspool -A; kubectl get pods -n rook-ceph. Expected evidence: Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes. If the run instead shows this symptom, stop and restore the last known state: Self-hosted data services compete for the same CPU, memory, and network as apps, and a simultaneous node loss can exceed configured replication durability.

Words you’ll hear

Rook-Ceph
For this lesson, Rook-Ceph is the controlling idea: Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes.
Longhorn
Longhorn is the checkpoint; run kubectl get cephcluster,longhornreplica,openebspool -A; kubectl get pods -n rook-ceph and inspect the owner chain. Self-hosted data services compete for the same CPU, memory, and network as apps, and a simultaneous node loss can exceed configured replication durability.
OpenEBS
OpenEBS is the outcome to preserve; the cost is explicit: They reduce cloud lock-in and add replication flexibility, but storage operators need dedicated capacity, recovery drills, upgrades, and deep failure-domain monitoring.
Verification evidence
The evidence command is kubectl get cephcluster,longhornreplica,openebspool -A; kubectl get pods -n rook-ceph. It connects the declaration to this behavior: Run software-defined storage in-cluster when cloud disks are not enough.

Visual diagram

Loading interactive diagram

Theory & deep dive

How Rook-Ceph reaches the intended state

Run software-defined storage in-cluster when cloud disks are not enough. Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes.

The concrete checkpoint is kubectl get cephcluster,longhornreplica,openebspool -A; kubectl get pods -n rook-ceph; compare the Rook-Ceph owner, Longhorn state, and OpenEBS outcome instead of treating YAML acceptance as proof.

Verify Longhorn, not only object creation

Run kubectl get cephcluster,longhornreplica,openebspool -A; kubectl get pods -n rook-ceph after the change and correlate the result with Events and the owning object. Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes.

Key takeaway: Rook-Ceph is implemented only when this invariant remains observable: Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes.

Longhorn: failure boundary and production cost

Self-hosted data services compete for the same CPU, memory, and network as apps, and a simultaneous node loss can exceed configured replication durability. The prerequisite contract is concrete: Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes.

They reduce cloud lock-in and add replication flexibility, but storage operators need dedicated capacity, recovery drills, upgrades, and deep failure-domain monitoring. A safe design limits blast radius, records the last good configuration, and uses kubectl get cephcluster,longhornreplica,openebspool -A; kubectl get pods -n rook-ceph as a deterministic rollback checkpoint.

Recover from Longhorn drift

Capture the current state with kubectl get cephcluster,longhornreplica,openebspool -A; kubectl get pods -n rook-ceph, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: Self-hosted data services compete for the same CPU, memory, and network as apps, and a simultaneous node loss can exceed configured replication durability.

Key takeaway: Accept the trade-off consciously: They reduce cloud lock-in and add replication flexibility, but storage operators need dedicated capacity, recovery drills, upgrades, and deep failure-domain monitoring.

How it works, step by step

Step 1 of 4
Data owner

1. Declare the data contract

State capacity, topology, access, and ownership in the claim or class: Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes.

Rook-Ceph contract → owned state
Key numbers at this step
Goal
Run software-defined storage in-cluster when cloud disks are not enough.
Owner
Rook-Ceph

When to use it & trade-offs

What it is

Run software-defined storage in-cluster when cloud disks are not enough. Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes.

Why it matters: Self-hosted data services compete for the same CPU, memory, and network as apps, and a simultaneous node loss can exceed configured replication durability. The invariant at risk is specific: Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes. The quickest fact check before changing the design is kubectl get cephcluster,longhornreplica,openebspool -A; kubectl get pods -n rook-ceph.

When to reach for it

  • Use Rook-Ceph to enforce this invariant: Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes.
  • Use Longhorn evidence from kubectl get cephcluster,longhornreplica,openebspool -A; kubectl get pods -n rook-ceph in reviews and incident timelines. Run software-defined storage in-cluster when cloud disks are not enough.
  • Choose the managed external data plane route only when this cost is justified by governance or scale: They reduce cloud lock-in and add replication flexibility, but storage operators need dedicated capacity, recovery drills, upgrades, and deep failure-domain monitoring.

When to avoid or be careful

  • Avoid assuming Rook-Ceph is complete after YAML submission; the required behavior is concrete: Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes.
  • Avoid treating the next symptom as random; check the owner and state with kubectl get cephcluster,longhornreplica,openebspool -A; kubectl get pods -n rook-ceph first: Self-hosted data services compete for the same CPU, memory, and network as apps, and a simultaneous node loss can exceed configured replication durability.
  • Avoid adopting a heavier platform wrapper before measuring its cost: They reduce cloud lock-in and add replication flexibility, but storage operators need dedicated capacity, recovery drills, upgrades, and deep failure-domain monitoring.

Native, manual, and managed paths for Rook-Ceph

Dynamically provisioned storage
Best for: Run software-defined storage in-cluster when cloud disks are not enough. A concrete incident check is kubectl get cephcluster,longhornreplica,openebspool -A; kubectl get pods -n rook-ceph.

Strengths: Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes.

Watch out: They reduce cloud lock-in and add replication flexibility, but storage operators need dedicated capacity, recovery drills, upgrades, and deep failure-domain monitoring. Recovery must also recognize this signal: Self-hosted data services compete for the same CPU, memory, and network as apps, and a simultaneous node loss can exceed configured replication durability.

Manual pre-provisioning
Best for: Quickly testing the Longhorn assumption with kubectl get cephcluster,longhornreplica,openebspool -A; kubectl get pods -n rook-ceph; the expected invariant is: Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes.

Strengths: kubectl get cephcluster,longhornreplica,openebspool -A; kubectl get pods -n rook-ceph gives immediate feedback without first building a platform layer.

Watch out: A manual change can hide drift, and unlike Rook-Ceph, it does not make this symptom self-documenting: Self-hosted data services compete for the same CPU, memory, and network as apps, and a simultaneous node loss can exceed configured replication durability.

Managed external data plane
Best for: Teams that need OpenEBS integrated with guardrails; the evidence path is kubectl get cephcluster,longhornreplica,openebspool -A; kubectl get pods -n rook-ceph.

Strengths: Platform controls can wrap this exact behavior in policy or dashboards: Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes.

Watch out: The added platform ownership buys value at this cost: They reduce cloud lock-in and add replication flexibility, but storage operators need dedicated capacity, recovery drills, upgrades, and deep failure-domain monitoring.

Interview signals & numbers to know

When this topic comes up

  • Interview anchor: Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes.
  • Trace Rook-Ceph to OpenEBS through Longhorn; the invariant is: Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes.
  • Recognize the symptom: Self-hosted data services compete for the same CPU, memory, and network as apps, and a simultaneous node loss can exceed configured replication durability.
  • Justify the cost: They reduce cloud lock-in and add replication flexibility, but storage operators need dedicated capacity, recovery drills, upgrades, and deep failure-domain monitoring.
  • Verify with kubectl get cephcluster,longhornreplica,openebspool -A; kubectl get pods -n rook-ceph instead of only inspecting YAML.

Benchmarks & rules of thumb

3 -
common self-hosted families mentioned: Rook-Ceph, Longhorn, and OpenEBS
2 -
replicas can tolerate some failures but not arbitrary correlated loss
1 -
dedicated failure-domain plan is mandatory for production

Common mistakes & follow-ups

Common interview mistakes

  • Debugging only the child object misses the Rook-Ceph owner contract: Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes.
  • Ignoring this telltale condition leads to unrelated changes: Self-hosted data services compete for the same CPU, memory, and network as apps, and a simultaneous node loss can exceed configured replication durability.
  • Repeating kubectl get cephcluster,longhornreplica,openebspool -A; kubectl get pods -n rook-ceph without an owner for remediation wastes retry cost. They reduce cloud lock-in and add replication flexibility, but storage operators need dedicated capacity, recovery drills, upgrades, and deep failure-domain monitoring.

Likely interviewer follow-ups

  • How would API output and runtime evidence prove this behavior: Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes?
  • Which owner object, logs, and Events would you inspect for this symptom-Self-hosted data services compete for the same CPU, memory, and network as apps, and a simultaneous node loss can exceed configured replication durability-?
  • At what threshold would this cost become unacceptable: They reduce cloud lock-in and add replication flexibility, but storage operators need dedicated capacity, recovery drills, upgrades, and deep failure-domain monitoring?
Interview tip: Interview sequence: state the invariant, run kubectl get cephcluster,longhornreplica,openebspool -A; kubectl get pods -n rook-ceph, name the failure, then justify the cost. Invariant: Rook-Ceph, Longhorn, and OpenEBS run storage control and often data services inside Kubernetes, using replication, erasure, or local disks to recover or distribute volumes. Failure: Self-hosted data services compete for the same CPU, memory, and network as apps, and a simultaneous node loss can exceed configured replication durability. Cost: They reduce cloud lock-in and add replication flexibility, but storage operators need dedicated capacity, recovery drills, upgrades, and deep failure-domain monitoring.

Knowledge check

Loading quiz

Put it into practice

Practice related interview Q&A

Apply Distributed & Self-Hosted Storage (Rook-Ceph, Longhorn, OpenEBS) with generative AI interview Q&A and hands-on practice.

Open DevOps Q&A →Tech Learn Q&A
Previous topic
Cloud Block & File Storage (AWS EBS/EFS, GCP Persistent Disk, Azure Disk)
Next topic
StatefulSet volumeClaimTemplates & Per-Pod Storage