Skip to main content
RunBook Academy

CephLXXXVII · Kubernetes CephFSKubernetes CephFS

CephFS failure behaviour in Kubernetes

Advanced⏱ ~18 minkubectlceph

What you'll learn

  • Predict pod behaviour during MDS failover
  • Handle client eviction correctly
  • Recover pods after a CephFS interruption
  • Configure for faster recovery

Prerequisites

None — start here.

Verified against Ceph Tentacle 20.2.x · Ceph Squid 19.2.x (supported previous) · cephadm matches the verified Ceph release · podman 4.x · csi-rbd and csi-cephfs current · RBD / CephFS / RGW current (matches Ceph release) · Linux kernel 5.15+ (5.10 minimum) · Ubuntu 24.04 LTS (Ceph host baseline) · Debian 12 (Bookworm) (Ceph host baseline) · Rocky Linux / RHEL / AlmaLinux 9.x (Ceph host baseline) · Proxmox VE 9.x (cross-course integration) · Kubernetes 1.31+ (cross-course integration) · 2026-08-18

Not yet marked complete on this device.

Why this matters in production

CephFS has an active component — the MDS — that RBD does not, and its failure modes are visible to pods in ways that OSD failures are not.

MDS failover

ceph fs status
ceph mds stat
ceph fs get cephfs | grep -E 'max_mds|standby'
Active MDS fails
  → monitors detect and promote a standby
  → the standby replays the journal
  → clients reconnect and re-establish capabilities
  → I/O resumes
Standby typeFailover time
standbyjournal replay from the start; slower
standby-replayalready following the journal; much faster
ceph fs set cephfs allow_standby_replay true
ceph fs status

standby-replay reduces failover from potentially minutes to seconds by keeping a standby continuously replaying the active MDS’s journal.

What pods experience

PhasePod behaviour
MDS failsmetadata operations block; data I/O to open files may continue
Standby promotingmetadata operations still blocked
Reconnect windowclients re-establish; brief continued blocking
Resumednormal
Data reads and writes to already-open files with existing capabilities
continue during a brief failover. Anything requiring the MDS — opening a
file, listing a directory, stat — blocks.

This is why a pod may appear partly functional during a failover.

Client eviction

ceph tell mds.0 client ls
ceph osd blocklist ls
A client that does not respond within the timeout is evicted
  → its capabilities are revoked
  → its mount becomes invalid
  → operations return ESTALE
  → the pod's volume is effectively broken until remounted
ceph config get mds mds_session_timeout
ceph config get mds mds_session_autoclose

Unlike an MDS failover, eviction does not resolve itself: the client’s mount is void and only a remount restores it.

Recovering pods after an interruption

# identify pods with a broken mount
kubectl get pods --field-selector status.phase=Running -o json | python3 -c '
import sys, json
for p in json.load(sys.stdin)["items"]:
    for c in p.get("status", {}).get("containerStatuses", []):
        if not c.get("ready"):
            print(p["metadata"]["namespace"], p["metadata"]["name"])'
# the remedy is a restart, which remounts
NAME=acme
kubectl delete pod ${NAME}
# clear the blocklist entry if the client should be allowed back
ADDR=10.20.0.11
ceph osd blocklist rm ${ADDR}

Restarting the pod causes the node plugin to unmount and remount, which establishes a fresh session.

Configuring for faster recovery

SettingEffect
allow_standby_replay truefailover in seconds rather than minutes
Several standby MDS daemonstolerates more simultaneous failures
max_mds above 1distributes metadata load; more failure surface
Metadata pool on NVMefaster journal replay
Adequate MDS memoryfewer capability recalls, fewer evictions
ceph config set mds mds_cache_memory_limit 8589934592
ceph orch apply mds cephfs --placement="count:3"

Quiz

Knowledge check · 4 questions

  1. Q1. Why does data I/O to open files continue during an MDS failover?

  2. Q2. Client eviction resolves itself once the network recovers, like an MDS failover.

  3. Q3. Reduce CephFS failover impact.

    An MDS failover took four minutes during which every pod using CephFS blocked on metadata operations. The filesystem has one active MDS and one plain standby.

  4. Q4. How is a pod recovered after its CephFS client is evicted?

Passing score: 75%. Answers are checked in this browser.

Production discipline

Enable allow_standby_replay — it reduces MDS failover from minutes to seconds and every CephFS pod blocks on metadata operations throughout that window. Recognise eviction as needing a pod restart; unlike a failover it does not resolve itself.

Cross-course references

  • Kubernetes: control plane component failover affects new operations more than running ones
  • Linux: NFS server failover has the same open-handle versus new-operation asymmetry