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 64/ 160
04. Storage & Persistent Data

Access Modes (ReadWriteOnce, ReadWriteMany, ReadOnlyMany)

Choose RWO, RWX, or ROX access modes that match how pods share storage.

BeginnerRWO · RWX · ROX3 quiz questions
Practice DevOps Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

In plain words

Access mode is the warehouse key policy: one node may edit, many may read, or many may edit when the lock system permits. The simple Kubernetes rule is: RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it.

Think of it like…

Access mode is the warehouse key policy: one node may edit, many may read, or many may edit when the lock system permits.

Where you’ve seen it

Before approving a data-path change, the storage owner runs kubectl get pvc shared -o jsonpath='{.spec.accessModes}'; kubectl get pv shared-pv -o wide. Expected evidence: RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it. If the run instead shows this symptom, stop and restore the last known state: Requesting RWX from a block volume or misunderstanding RWO as one-Pod-only can lead to Pending claims or unsafe concurrent consumers.

Words you’ll hear

RWO
For this lesson, RWO is the controlling idea: RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it.
RWX
RWX is the checkpoint; run kubectl get pvc shared -o jsonpath='{.spec.accessModes}'; kubectl get pv shared-pv -o wide and inspect the owner chain. Requesting RWX from a block volume or misunderstanding RWO as one-Pod-only can lead to Pending claims or unsafe concurrent consumers.
ROX
ROX is the outcome to preserve; the cost is explicit: Access modes describe attachment capabilities, not application record locking, backups, or read-after-write consistency across replicas.
Verification evidence
The evidence command is kubectl get pvc shared -o jsonpath='{.spec.accessModes}'; kubectl get pv shared-pv -o wide. It connects the declaration to this behavior: Choose RWO, RWX, or ROX access modes that match how pods share storage.

Visual diagram

Loading interactive diagram

Theory & deep dive

How RWO reaches the intended state

Choose RWO, RWX, or ROX access modes that match how pods share storage. RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it.

The concrete checkpoint is kubectl get pvc shared -o jsonpath='{.spec.accessModes}'; kubectl get pv shared-pv -o wide; compare the RWO owner, RWX state, and ROX outcome instead of treating YAML acceptance as proof.

Verify RWX, not only object creation

Run kubectl get pvc shared -o jsonpath='{.spec.accessModes}'; kubectl get pv shared-pv -o wide after the change and correlate the result with Events and the owning object. RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it.

Key takeaway: RWO is implemented only when this invariant remains observable: RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it.

RWX: failure boundary and production cost

Requesting RWX from a block volume or misunderstanding RWO as one-Pod-only can lead to Pending claims or unsafe concurrent consumers. The prerequisite contract is concrete: RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it.

Access modes describe attachment capabilities, not application record locking, backups, or read-after-write consistency across replicas. A safe design limits blast radius, records the last good configuration, and uses kubectl get pvc shared -o jsonpath='{.spec.accessModes}'; kubectl get pv shared-pv -o wide as a deterministic rollback checkpoint.

Recover from RWX drift

Capture the current state with kubectl get pvc shared -o jsonpath='{.spec.accessModes}'; kubectl get pv shared-pv -o wide, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: Requesting RWX from a block volume or misunderstanding RWO as one-Pod-only can lead to Pending claims or unsafe concurrent consumers.

Key takeaway: Accept the trade-off consciously: Access modes describe attachment capabilities, not application record locking, backups, or read-after-write consistency across replicas.

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: RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it.

RWO contract → owned state
Key numbers at this step
Goal
Choose RWO, RWX, or ROX access modes that match how pods share storage.
Owner
RWO

When to use it & trade-offs

What it is

Choose RWO, RWX, or ROX access modes that match how pods share storage. RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it.

Why it matters: Requesting RWX from a block volume or misunderstanding RWO as one-Pod-only can lead to Pending claims or unsafe concurrent consumers. The invariant at risk is specific: RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it. The quickest fact check before changing the design is kubectl get pvc shared -o jsonpath='{.spec.accessModes}'; kubectl get pv shared-pv -o wide.

When to reach for it

  • Use RWO to enforce this invariant: RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it.
  • Use RWX evidence from kubectl get pvc shared -o jsonpath='{.spec.accessModes}'; kubectl get pv shared-pv -o wide in reviews and incident timelines. Choose RWO, RWX, or ROX access modes that match how pods share storage.
  • Choose the managed external data plane route only when this cost is justified by governance or scale: Access modes describe attachment capabilities, not application record locking, backups, or read-after-write consistency across replicas.

When to avoid or be careful

  • Avoid assuming RWO is complete after YAML submission; the required behavior is concrete: RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it.
  • Avoid treating the next symptom as random; check the owner and state with kubectl get pvc shared -o jsonpath='{.spec.accessModes}'; kubectl get pv shared-pv -o wide first: Requesting RWX from a block volume or misunderstanding RWO as one-Pod-only can lead to Pending claims or unsafe concurrent consumers.
  • Avoid adopting a heavier platform wrapper before measuring its cost: Access modes describe attachment capabilities, not application record locking, backups, or read-after-write consistency across replicas.

Native, manual, and managed paths for RWO

Dynamically provisioned storage
Best for: Choose RWO, RWX, or ROX access modes that match how pods share storage. A concrete incident check is kubectl get pvc shared -o jsonpath='{.spec.accessModes}'; kubectl get pv shared-pv -o wide.

Strengths: RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it.

Watch out: Access modes describe attachment capabilities, not application record locking, backups, or read-after-write consistency across replicas. Recovery must also recognize this signal: Requesting RWX from a block volume or misunderstanding RWO as one-Pod-only can lead to Pending claims or unsafe concurrent consumers.

Manual pre-provisioning
Best for: Quickly testing the RWX assumption with kubectl get pvc shared -o jsonpath='{.spec.accessModes}'; kubectl get pv shared-pv -o wide; the expected invariant is: RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it.

Strengths: kubectl get pvc shared -o jsonpath='{.spec.accessModes}'; kubectl get pv shared-pv -o wide gives immediate feedback without first building a platform layer.

Watch out: A manual change can hide drift, and unlike RWO, it does not make this symptom self-documenting: Requesting RWX from a block volume or misunderstanding RWO as one-Pod-only can lead to Pending claims or unsafe concurrent consumers.

Managed external data plane
Best for: Teams that need ROX integrated with guardrails; the evidence path is kubectl get pvc shared -o jsonpath='{.spec.accessModes}'; kubectl get pv shared-pv -o wide.

Strengths: Platform controls can wrap this exact behavior in policy or dashboards: RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it.

Watch out: The added platform ownership buys value at this cost: Access modes describe attachment capabilities, not application record locking, backups, or read-after-write consistency across replicas.

Interview signals & numbers to know

When this topic comes up

  • Interview anchor: RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it.
  • Trace RWO to ROX through RWX; the invariant is: RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it.
  • Recognize the symptom: Requesting RWX from a block volume or misunderstanding RWO as one-Pod-only can lead to Pending claims or unsafe concurrent consumers.
  • Justify the cost: Access modes describe attachment capabilities, not application record locking, backups, or read-after-write consistency across replicas.
  • Verify with kubectl get pvc shared -o jsonpath='{.spec.accessModes}'; kubectl get pv shared-pv -o wide instead of only inspecting YAML.

Benchmarks & rules of thumb

3 -
access modes: RWO, RWX, and ROX
1 -
node, not one Pod, is the RWO granularity for most implementations
0 -
guarantees that RWX provides application-level transaction locking

Common mistakes & follow-ups

Common interview mistakes

  • Debugging only the child object misses the RWO owner contract: RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it.
  • Ignoring this telltale condition leads to unrelated changes: Requesting RWX from a block volume or misunderstanding RWO as one-Pod-only can lead to Pending claims or unsafe concurrent consumers.
  • Repeating kubectl get pvc shared -o jsonpath='{.spec.accessModes}'; kubectl get pv shared-pv -o wide without an owner for remediation wastes retry cost. Access modes describe attachment capabilities, not application record locking, backups, or read-after-write consistency across replicas.

Likely interviewer follow-ups

  • How would API output and runtime evidence prove this behavior: RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it?
  • Which owner object, logs, and Events would you inspect for this symptom-Requesting RWX from a block volume or misunderstanding RWO as one-Pod-only can lead to Pending claims or unsafe concurrent consumers-?
  • At what threshold would this cost become unacceptable: Access modes describe attachment capabilities, not application record locking, backups, or read-after-write consistency across replicas?
Interview tip: Interview sequence: state the invariant, run kubectl get pvc shared -o jsonpath='{.spec.accessModes}'; kubectl get pv shared-pv -o wide, name the failure, then justify the cost. Invariant: RWO permits mounting as read-write by a single node, ROX permits read-only use by multiple nodes, and RWX permits concurrent read-write attachment from multiple nodes only when the driver supports it. Failure: Requesting RWX from a block volume or misunderstanding RWO as one-Pod-only can lead to Pending claims or unsafe concurrent consumers. Cost: Access modes describe attachment capabilities, not application record locking, backups, or read-after-write consistency across replicas.

Knowledge check

Loading quiz

Put it into practice

Practice related interview Q&A

Apply Access Modes (ReadWriteOnce, ReadWriteMany, ReadOnlyMany) with generative AI interview Q&A and hands-on practice.

Open DevOps Q&A →Tech Learn Q&A
Previous topic
PersistentVolumes (PV) & PersistentVolumeClaims (PVC)
Next topic
Reclaim Policies (Retain, Delete, Recycle)