Access Modes (ReadWriteOnce, ReadOnlyMany and More) in Kubernetes
A friendly, step-by-step guide to the labels that say who may use a storage volume and how: what each access mode means, how Kubernetes matches them, why pods get stuck because of them, and how to choose the right one.
Imagine a shared office with a few different kinds of storage. There is a private locker with one key, which only one person may open at a time. There is a noticeboard that everybody may read but nobody may change. And there is a big shared whiteboard where anyone may write, as long as they are careful not to scribble over each other. Each kind of storage has its own rule about who may use it and how.
Kubernetes storage has exactly such rules. They are called access modes, and they carry names like ReadWriteOnce, ReadOnlyMany and ReadWriteMany. They look like small technical labels, yet they decide whether your pod starts, where it may run, and whether several copies of your application can share the same files.
In this guide we build the idea from zero. Every new word is explained the first time it appears, and every big idea comes with an everyday comparison so it sticks. By the end you will know what each mode really means, what it does not mean, how Kubernetes uses it, and how to avoid the classic mistakes that leave pods waiting forever.
1What Are Access Modes?
To understand access modes we first need a handful of simple words: volume, node, pod, claim and mode.
Volume
A volume is a folder of storage that a pod can use. Unlike a container’s own files, a persistent volume keeps its data even after the pod is gone.
Node
A node is one computer in the cluster. Many pods can run on one node, and a cluster usually has several nodes.
Pod
A pod is the smallest unit Kubernetes runs. It holds one or more containers that live together on one node.
Persistent volume
A persistent volume, often shortened to PV, is a piece of real storage that has been registered with the cluster and is ready to be used.
Persistent volume claim
A claim, often shortened to PVC, is a request for storage made by a user. It says how much space is needed and how the storage will be used.
Access mode
An access mode is a label that describes how many nodes, or pods, may use a volume at once, and whether they may write or only read.
So what exactly is an access mode?
An access mode is a statement about a storage volume. It answers two simple questions. First, who may attach to the volume at the same time: one node, many nodes, or a single pod. Second, what they may do: read and write, or read only. Every persistent volume lists the modes its storage can support, and every claim lists the mode it needs. Kubernetes then matches claims to volumes so that a pod only receives storage that behaves the way it expects.
Think of access modes as the label on the box, not the lock on the door. They describe what the storage is designed for, and Kubernetes uses that description to make sensible decisions. This difference between a label and a lock will matter a great deal later in this guide.
Think of a library. A reference copy that may be read in the reading room by anyone but never borrowed is like read-only for many. A borrowed book that goes home with exactly one reader is like read-write for one. A shared study room with a whiteboard, where several readers may write, is like read-write for many. The access mode is the sign on the shelf that says which kind of item it is.
The four modes at a glance
Kubernetes defines four access modes. Three are old and well known. The fourth is newer and more strict.
ReadWriteOnce, short name RWO
The volume can be mounted as read-write by a single node. Several pods on that same node may still use it together.
ReadOnlyMany, short name ROX
The volume can be mounted as read-only by many nodes at the same time.
ReadWriteMany, short name RWX
The volume can be mounted as read-write by many nodes at the same time.
ReadWriteOncePod, short name RWOP
The volume can be mounted as read-write by a single pod in the whole cluster. It is the strictest mode and needs a recent Kubernetes version.
The short names RWO, ROX, RWX and RWOP appear in the output of storage listings, so learn them now. When you see RWO in a listing, read it as “one node may write”.
2The Problem Access Modes Solve
Storage is not all alike. Some kinds can be shared by many machines, and some can be held by only one. A cluster must know the difference before it places your pod.
Real storage has real limits
Behind every persistent volume sits a real technology: a network disk in a cloud, a shared file server, a distributed file system or a disk inside a machine. Each behaves differently. A cloud block disk is like a hard drive plugged into a single computer, and it cannot safely be plugged into two computers at once. A shared file server, on the other hand, is built to serve many computers together. Kubernetes has to respect these facts, or data gets corrupted.
Two writers, one disk
If two computers write to the same simple disk without coordination, they overwrite each other’s work and the disk can be damaged.
Wrong storage for the job
An application that needs many copies sharing files would fail on storage built for a single machine.
Surprises at deployment
Without a clear label, a pod might be placed somewhere its storage cannot follow, and get stuck.
Accidental changes
Shared reference data needs protection from being modified by some application by mistake.
Many storage products
Dozens of storage systems exist. The cluster needs one simple vocabulary that works for all of them.
Communication between teams
Developers know what their application needs. Administrators know what their storage offers. They need a shared language.
What people did before
| Old approach | How it worked | Why it hurt |
|---|---|---|
| Name the exact disk | Every application definition named a specific disk or server | Applications were tied to particular storage and could not move |
| Rely on tribal knowledge | Administrators remembered which disks were shareable | Mistakes when people left or forgot |
| Attach by hand | Operators attached disks to machines manually | Slow, error-prone and impossible to automate safely |
| Use shared storage for everything | Everything went on one shared file server | Slow for databases and a single point of failure |
flowchart LR
subgraph W["Without access modes"]
A1["App asks for storage"] --> B1["Any disk is handed over"]
B1 --> C1["Two nodes write to a single-node disk"]
C1 --> D1["Data damage or stuck pods"]
end
subgraph V["With access modes"]
A2["App asks for storage and states how it will be used"] --> B2["Kubernetes matches a compatible volume"]
B2 --> C2["Volume behaves as promised"]
end
Reading Figure 1
The left half shows what could go wrong. An application asks for storage and simply receives some disk. If that disk is built for a single machine and two machines write to it, the data is damaged or the pod gets stuck. The right half shows the calmer world. The application states how it will use the storage. Kubernetes looks for a volume that promises compatible behaviour. The application receives what it expects, and the risky mismatch is caught before any pod starts.
Picture a car rental desk. If you say only “I need a vehicle”, you might be handed a motorbike for your family of five. If you say “five seats, one week, motorway driving”, the desk finds a suitable car. Access modes are the “five seats” of storage: a short statement of how the thing will be used.
3Core Concepts You Need First
Access modes sit inside a small family of storage objects. Meet the family first, and the modes will make sense.
Persistent volume
The real storage, registered in the cluster. It lists its size and the access modes it supports.
Persistent volume claim
The request. It lists the size and the access mode the user needs, and it belongs to one namespace.
Storage class
A recipe that says how to create new volumes automatically on demand, for a certain kind of storage.
Storage driver
The plug-in, called a CSI driver, that talks to the real storage system to create, attach and mount volumes.
Pod volume section
The part of a pod definition that names the claim to use, and where to mount it inside the container.
Mount
The act of making a volume appear as a folder inside a container.
Two ideas that people mix up
Two words sound similar and mean different things: attach and mount. To attach a volume means to connect the storage to a node, like plugging a disk into a computer. To mount means to make the connected storage appear as a folder that a container can see. The access mode’s “once” and “many” refer to the node level: how many nodes may have the volume attached. That is why RWO allows several pods, so long as they all sit on the same node.
| Mode | Short name | Who may attach | What they may do |
|---|---|---|---|
| ReadWriteOnce | RWO | One node at a time | Read and write |
| ReadOnlyMany | ROX | Many nodes at once | Read only |
| ReadWriteMany | RWX | Many nodes at once | Read and write |
| ReadWriteOncePod | RWOP | One single pod in the cluster | Read and write |
Think of an external hard drive. Plugging it into a laptop is attaching. Opening its folder on the desktop is mounting. Access modes decide how many laptops may have that drive plugged in at once. Two apps on the same laptop can both open the folder, which mirrors two pods on the same node sharing an RWO volume.
The label and the lock
Here is the most important idea in the whole guide. An access mode is a description of what the storage can do, used by Kubernetes for matching and scheduling. It is not a full security lock. Kubernetes does not, on its own, stop a volume from being used in a way that the storage cannot actually handle. The real safety comes from the storage system’s own behaviour, together with careful use of the mode. For example, marking a claim as read-only in a pod is enforced at mount time, but nothing in the label prevents an administrator from mounting the same underlying disk somewhere else outside Kubernetes.
Never treat an access mode as a substitute for permissions or for application-level coordination. It tells Kubernetes what to expect and how to schedule. It does not make unsafe sharing safe.
Who chooses what
| Actor | Decides | Where the mode appears |
|---|---|---|
| Storage administrator | Which modes each volume or storage class supports | On the persistent volume or storage class |
| Application developer | Which mode the application needs | On the persistent volume claim |
| Kubernetes | Which volume satisfies which claim | Matching and scheduling decisions |
| Storage driver | Whether it can actually deliver the mode | Driver capabilities |
4Architecture and Components
Several pieces cooperate between a claim and a real disk. It helps to see who talks to whom.
flowchart TB
U["User writes a claim with an access mode"] --> PVC["Persistent volume claim"]
PVC -->|"Matched or created"| PV["Persistent volume with supported modes"]
SC["Storage class"] -->|"Recipe for new volumes"| PV
PV --> CSI["Storage driver"]
CSI --> ST["Real storage system"]
POD["Pod names the claim"] --> PVC
SCH["Scheduler"] -->|"Chooses a node that can use the volume"| POD
KL["Kubelet on the node"] -->|"Asks driver to attach and mount"| CSI
Reading Figure 2 piece by piece
Start at the top left. A user writes a claim that asks for some space and names an access mode. Kubernetes tries to find a persistent volume that satisfies it. If none exists and the claim names a storage class, the class acts as a recipe to create a fresh volume on demand. The volume is backed by a real storage system through a driver.
On the other side, a pod names the claim in its definition. The scheduler must choose a node for the pod, and it takes the volume’s constraints into account, such as whether the volume is already attached elsewhere. Once a node is chosen, the kubelet on that node asks the driver to attach the volume to the node and mount it into the container.
The parts, one by one
Control loop for binding
A controller in the cluster’s control plane watches claims and volumes and pairs them when their sizes and modes fit.
Provisioner
The part of the storage driver that creates new volumes when a claim asks for one through a storage class.
Attach and detach controller
Coordinates connecting and disconnecting volumes from nodes, and refuses attachments that would break the mode.
Kubelet volume manager
Runs on each node, mounts volumes into pods and unmounts them when pods finish.
Scheduler volume rules
Considers volume location and readiness when choosing a node, and can wait until a pod exists before creating storage.
Storage system
The real disks or file servers whose physical nature decides which modes are truly possible.
Who really enforces the mode?
The attach and detach controller, together with the driver, is the piece that acts on the mode in practice. If a volume is marked for single-node use and it is already attached to one node, a request to attach it to a second node is refused or delayed. The pod that needed it stays in a waiting state and reports a message about the volume. This behaviour is the source of many puzzling pod problems, and we return to it in detail in later chapters.
Think of a hotel key system. The guest fills a booking form stating needs: a room for one, or a conference room for many. The front desk matches the form to real rooms. The porter opens the door when the guest arrives, and a rule in the key system refuses a second key for a single-occupancy room already in use. The booking form is the claim, the room list is the volumes, and the key system is the attach controller.
When a pod is stuck waiting for storage, decide first which stage failed: matching the claim, creating the volume, choosing a node, attaching to the node or mounting in the pod. Each stage has its own clues.
5How Access Modes Work Internally
Now let us open the box. We will see how Kubernetes matches a claim to a volume, and then how it uses the mode when attaching storage to a node.
Matching a claim to a volume
When a claim appears, a controller looks for a volume that satisfies several conditions at once. The volume must be large enough. It must belong to the same storage class as the claim, or both must have none. Its list of supported modes must include every mode the claim asks for. Any label selector on the claim must match the volume. And the volume must not already belong to another claim. From the volumes that pass, the controller usually picks the smallest one that fits, to avoid waste.
flowchart TD
S["New claim arrives"] --> A{"Existing volume large enough?"}
A -->|"No"| N["Try to create a new volume through the storage class"]
A -->|"Yes"| B{"Same storage class?"}
B -->|"No"| N
B -->|"Yes"| C{"Volume supports the requested access mode?"}
C -->|"No"| N
C -->|"Yes"| D{"Volume still free and selector matches?"}
D -->|"No"| N
D -->|"Yes"| OK["Bind claim to the smallest matching volume"]
N --> E{"Creation possible?"}
E -->|"Yes"| OK
E -->|"No"| P["Claim stays pending"]
Reading Figure 3
A new claim first goes through four tests against existing volumes: size, storage class, mode and freedom. Failing any test sends the claim to the “create new” path. If a storage class and driver exist, a new volume is created with the requested mode and the claim is bound to it. If creation is impossible, for example because the driver cannot provide the requested mode, the claim stays pending, with an event that explains the reason.
Two details are worth remembering. First, the mode test is a subset test: a volume that supports several modes can satisfy a claim that asks for just one of them. Second, once a claim and a volume are bound, the pair is exclusive. The binding is one to one, even if the volume’s mode says many nodes may use it.
Many modes on the volume, one in use
A persistent volume may list several supported modes, for example single-node write and many-node read-only. But only one mode is in effect at any moment. A volume cannot be mounted with two different modes at the same time. If a volume supports both, the first way it is used decides the mode until it is released.
A meeting room may be bookable either as a private office or as an open workshop. Both are possible, but not at the same time. Once someone books it as a private office, nobody else can use it as a workshop until they leave.
From claim to attached disk
Step one: binding
The claim and a matching volume are paired. Nothing is attached to any node yet. The claim is now ready to be used by pods.
Step two: scheduling
When a pod that uses the claim is created, the scheduler chooses a node. It considers where the volume lives, whether it is already attached elsewhere, and whether the pod’s other needs fit.
Step three: attaching
For network disks, the attach controller asks the driver to connect the disk to the chosen node. For single-node modes, the disk must first be free of any other node.
Step four: mounting
The kubelet formats the disk if it is new, mounts it on the node and then into the container’s folder, read-only or read-write as requested.
Static and dynamic provisioning
Volumes reach a claim in two ways. In static provisioning, an administrator creates volumes by hand ahead of time, listing each one’s size and supported modes, and claims bind to whichever fits. In dynamic provisioning, nobody pre-creates anything. A claim names a storage class, and the driver creates a fresh volume on demand with exactly the requested size and mode. Dynamic provisioning is far more common today, because it removes waiting and guesswork. With static volumes the administrator must decide the modes in advance and get them right. With dynamic volumes, the class and driver decide which modes are possible, and a request outside that set simply fails to provision.
One consequence is that with dynamic provisioning, the practical question is not “which volume matches” but “which class can create the mode I need”. Choosing the class is therefore choosing the mode’s feasibility.
Location matters for many storage kinds
Many cloud disks live in one data-centre zone and can only be attached to nodes in that same zone. To avoid creating a disk in a zone where the pod cannot run, storage classes often use a setting that delays creation until a pod is scheduled, called wait for first consumer. The disk is then created in the zone where the pod actually landed. This detail interacts with access modes because a single-node disk pins the pod to the disk’s zone from then on.
The mode on a claim is a request, and the driver decides whether it can be honoured. A claim can bind successfully and still fail later at attach time if the underlying storage cannot handle how the pods are laid out on nodes.
6Data Flow and Lifecycle
Let us follow one volume from the moment a claim is written to the moment the pod is gone.
sequenceDiagram
participant U as User
participant C as Binding controller
participant D as Storage driver
participant S as Scheduler
participant A as Attach controller
participant K as Kubelet
U->>C: Create claim with an access mode
C->>D: Create a volume that supports the mode
D-->>C: Volume ready
C-->>U: Claim bound
U->>S: Create pod that uses the claim
S->>S: Choose a node that can use the volume
S->>A: Pod placed on node
A->>D: Attach the volume to the node
D-->>A: Attached
K->>D: Mount into the pod
K-->>U: Pod running with storage
U->>K: Delete pod later
K->>D: Unmount
A->>D: Detach from the node
Reading Figure 4
The story begins with the user creating a claim. The binding controller asks the driver to create a suitable volume, and the claim becomes bound. Later a pod that uses the claim is created. The scheduler picks a node, the attach controller connects the volume to that node, and the kubelet mounts it into the pod. When the pod is deleted, the kubelet unmounts the volume and the attach controller detaches it. Only after detaching can a single-node volume be attached somewhere else.
Six stages of a volume’s life
Requested
The claim exists and lists size and mode. It is pending until a volume matches.
Bound
A volume is paired with the claim. The pair belongs together until the claim is deleted.
Scheduled
A pod using the claim is placed on a node that can reach the volume.
Attached
The volume is connected to the node, respecting the single-node or many-node mode.
Mounted and in use
The pod reads and writes its files, or only reads if the mount is read-only.
Released
The pod ends, the volume is unmounted and detached, and it may move on to another pod.
What if something goes wrong?
If the pod is deleted and the node is fine, detach happens quickly. But if the node itself crashes, the cluster may not know for certain that the disk is no longer in use there. To avoid two nodes writing at once, Kubernetes and the driver are cautious: they wait until the old node is confirmed gone or the attachment is safely released. That safety delay is why a replacement pod on a new node can take several minutes to start after a node failure. It is a price paid for protecting data.
When a pod is rescheduled to another node
A single-node volume must detach from the old node before it attaches to the new one. This is quick in normal cases and slow after failures.
When many pods share a many-node volume
The volume attaches, or is mounted over the network, on each node where a pod runs. Pods come and go without detaching it from other nodes.
When the claim is deleted
What happens to the data depends on the volume’s reclaim behaviour: it may be deleted, or kept for manual clean-up. Access modes do not change this.
Think of a single-copy library book. If the reader who borrowed it says they have lost their house and cannot check in, the library will not lend it to anyone else until it is certain the first copy is truly gone. Careful, slow, and safe.
The slow start after a node failure is not a bug. It is protection. Design your application to tolerate a few minutes of unavailability, or use storage that supports many-node access if you need faster recovery.
7The Four Modes in Depth
Each mode has a personality, common uses and common traps. Let us meet them one at a time.
ReadWriteOnce: one node writes
ReadWriteOnce is the most common mode, and the most misunderstood. It says that the volume can be mounted read-write by one node at a time. The word “once” refers to the node, not to the pod. If three pods land on the same node, all three may use the volume together. If they land on different nodes, only the first node succeeds, and the others must wait.
Databases and single-instance apps
Applications with a single writer that keep their own files, such as a database or a message queue.
Block disks
Cloud network disks and local disks are typically single-node by nature.
Several replicas on several nodes
Scaling a deployment that shares one such claim can leave extra pods stuck on other nodes.
Rolling updates
The new pod may start on a different node before the old one releases the disk, causing a wait or an error.
flowchart LR
subgraph N1["Node 1"]
OLD["Old pod, using the volume"]
end
subgraph N2["Node 2"]
NEW["New pod, needs the same volume"]
end
V["Single-node volume, attached to Node 1"]
OLD --> V
NEW -.->|"Cannot attach while Node 1 holds it"| V
Reading Figure 5
The old pod sits on the first node, holding the volume. During an update, Kubernetes wants to start the new pod before removing the old one, to avoid downtime. If the scheduler places the new pod on the second node, that node needs the volume too. The volume is still attached to the first node, so the attachment is refused. The new pod waits, the old pod cannot be removed because the update expects the new pod to become ready, and the rollout appears frozen. Solutions are covered in Chapter 10.
ReadOnlyMany: many nodes read
ReadOnlyMany allows many nodes to mount the volume at once, but only for reading. It suits reference data that must be shared without risk of change: configuration bundles, machine-learning models, static website content and shared libraries. The data is usually prepared beforehand, for example by restoring a snapshot or copying files in a one-off job, and then presented read-only to all consumers.
ReadWriteMany: many nodes write
ReadWriteMany allows many nodes to mount and write at once. It is the mode most people want and the hardest to provide, because the storage itself must coordinate the writers. It is backed by network file systems and distributed file systems rather than plain block disks. Typical uses include shared upload folders for web servers, content management systems and shared working areas for batch jobs.
The storage coordinates access to files, but it cannot coordinate the meaning of the data. Two application copies writing to the same file at the same moment can still corrupt it, unless the application uses locking or writes to distinct files. Databases are usually a poor fit for shared file storage for exactly this reason.
ReadWriteOncePod: one pod writes
ReadWriteOncePod is a stricter form of single-writer access. It guarantees that only one pod in the entire cluster can use the volume at once, even if other pods sit on the same node. It was added to close the gap left by the “once per node” behaviour. It is ideal for applications that must never have two instances touching the same data. Support depends on the Kubernetes version and on the storage driver, so verify both before relying on it.
| Question | RWO | ROX | RWX | RWOP |
|---|---|---|---|---|
| Nodes at once | One | Many | Many | One |
| Pods at once | Many on that node | Many | Many | Exactly one |
| Can write | Yes | No | Yes | Yes |
| Typical storage | Block disks | Shared read-only sources, snapshots | Network file systems | Block disks with driver support |
| Typical use | Databases, single-instance apps | Reference data, models | Shared uploads, shared workspaces | Strict single-instance apps |
| Biggest trap | Extra pods on other nodes stay stuck | Needs the data prepared beforehand | Application-level write conflicts | Version and driver support |
Five common misconceptions
Misconception one: “ReadWriteOnce means only one pod”
It means one node. Many pods on that node can share the volume. Only the newer single-pod mode limits pods.
Misconception two: “ReadWriteMany makes any application safe to scale”
It lets many nodes mount the volume. Whether the application can safely share files is a separate design question about locking and file naming.
Misconception three: “ReadOnlyMany means the data is protected forever”
It protects the data from writes through that mount. Someone with direct access to the storage, or another mount with write access, can still change it.
Misconception four: “The mode I request is the mode I get”
Kubernetes matches your request to what the volume advertises, and the driver decides what it can deliver. Always confirm with a real test on more than one node.
Misconception five: “Access modes limit how many claims can bind”
A volume binds to exactly one claim regardless of mode. Many-node modes describe how many nodes may use that one bound volume.
Think of a photocopier room. One machine can be reserved by one department at a time, as with RWO. A notice board is readable by every department, as with ROX. A shared drawing wall may be written on by every department, but they must agree to keep out of each other’s corners, as with RWX. A private safe with a single key holder is RWOP.
This article was written without live web research. Support for RWOP and the exact behaviour of each driver evolve across releases, so confirm the details in the documentation for your Kubernetes version and your storage driver.
8Which Storage Supports Which Mode
A mode is only useful if the storage behind it can deliver it. Here is the general picture, with the reminder that drivers differ and change.
| Storage kind | Typical modes | Why |
|---|---|---|
| Cloud block disks | RWO, and RWOP with support | A block disk behaves like a hard drive attached to a single computer |
| Some block disks with multi-attach features | Limited sharing in special modes | Requires careful, cluster-aware file systems on top |
| Managed file services in clouds | RWX, often ROX too | They are network file servers designed for many clients |
| Classic network file servers | RWX, ROX, RWO | File servers can serve many clients, and support all three access styles |
| Distributed file systems | RWX, ROX, RWO | Built to share files across many machines |
| Distributed block storage | RWO, RWX only in raw block mode with care | Block devices are single-writer by nature |
| Local disks in a node | RWO | The disk lives inside one machine, so only that node can use it |
| Empty temporary folders | Not applicable | They are not persistent volumes and vanish with the pod |
Why the same mode can behave differently
Two drivers that both say “many nodes, read-write” may behave differently under pressure. One might offer strict file locking, another might not. One might be fast for small files, another for big streams. The mode tells Kubernetes what may be attached; it says nothing about speed, locking guarantees or consistency. Always test the storage for your actual workload.
Testing a mode before you trust it
A short experiment beats a long debate. Create a test claim in the mode you need and start two small test pods that use it, forcing them onto different nodes. For a single-node mode, expect the second pod to wait, and confirm that the message names the volume and the first node. For a many-node mode, expect both pods to run, then write a file from one pod and read it from the other. Try deleting the first pod and watch how quickly the second keeps working. Repeat the test after a simulated node failure in a non-production cluster. Keep the results in your team’s notes, together with the storage class name and the driver version, so that future upgrades can be checked against the same experiment in minutes.
How to find out what your storage supports
Read the driver’s documentation
Each storage driver lists the modes it can provide for each kind of volume.
Look at the storage class
Classes are often named for their purpose. Read what they create and which parameters they use.
Try a small test claim
Create a test claim and a test pod in each mode you need, and watch what happens on more than one node.
Ask your administrator
Storage teams often know quirks, limits and good practice that the documentation only hints at.
A cloud-first example
On a major cloud, a typical default class creates block disks, which give single-node access. If you ask that class for many-node write access, the claim stays pending or fails. To get many-node access, you choose a class that creates shared file storage instead, and accept its different speed and cost profile.
An on-premise example
A team with a network file server can offer many-node access by exposing shares as volumes. The same team may also run a distributed storage system that provides fast single-node block volumes for databases. They offer both through different classes and let developers choose.
A menu may list “vegetarian” for several dishes, but a vegetarian burger and a vegetarian curry are very different meals. The label is helpful and tells you the essentials, but you still taste before ordering for a banquet.
9Security and Data Safety
Access modes are about safe sharing, but they are only one layer. This chapter shows what they protect, what they leave open, and what else you need.
What access modes do protect
Modes help prevent one class of accident: two machines writing to storage that cannot handle it. By refusing a second attachment to a single-node volume, the cluster protects file systems from corruption. By presenting a volume read-only, it protects reference data from accidental change by applications.
What they do not protect
Who may use the claim
Any pod in the claim’s namespace may name the claim. Modes do not decide which teams or pods are trusted.
File permissions
Ordinary file ownership and permission rules still apply inside the volume. A mode does not grant or block them.
Application-level conflicts
Two writers on a shared volume can still overwrite the same file. Nothing in the mode coordinates their logic.
Access outside the cluster
Anyone with access to the storage system directly can bypass Kubernetes and its labels entirely.
Data confidentiality
Modes do not encrypt data. Use encryption at rest and in transit provided by the storage or the driver.
Backups
A shared volume can be damaged as easily as a single one. Modes are not a backup plan.
Layers that complete the picture
| Layer | What it does | Who controls it |
|---|---|---|
| Access mode | Describes and enforces node-level sharing rules | Volume and claim definitions |
| Read-only mount | Prevents a pod from writing to the volume | Pod definition |
| Role-based access control | Decides who may create claims and volumes | Cluster administrators |
| Namespaces | Keep claims within a team’s boundary | Cluster design |
| Storage encryption | Protects data on disk and on the wire | Storage and driver settings |
| File permissions and user identity | Control who can open which files | Pod security settings and file ownership |
| Backups and snapshots | Allow recovery after mistakes or attacks | Storage and operations |
Read-only, at two levels
There are two separate ways to make a volume read-only, and people often mix them up. One is the access mode on the claim and volume, such as read-only for many nodes, which describes how the storage may be attached. The other is a read-only setting on the pod’s own mount, which prevents that pod from writing even if the underlying volume allows writing. For a single-node volume that one pod must only read, use the pod-level setting. For shared reference data across many nodes, use the read-only mode and also mount read-only in each pod, so both layers agree.
A museum artefact can be protected in two ways: by a glass case built around it, and by a sign asking visitors not to touch. The case is the storage-level rule, and the sign is the pod-level rule. A careful museum uses both.
Shared writable volumes widen the blast radius of a mistake or a compromise. A compromised pod with write access to a shared volume may be able to alter files that many other applications trust. Share writable storage only where you must, and keep the set of pods that can write as small as possible.
10Choosing the Right Mode and Workload Shape
The mode you need depends on how many copies of your application run, where they run and who writes.
flowchart TD
A["What does my application do with the storage?"] --> B{"Does it only read shared data?"}
B -->|"Yes"| C["ReadOnlyMany"]
B -->|"No, it writes"| D{"Do many pods on many nodes need to write to the same volume?"}
D -->|"Yes"| E["ReadWriteMany on shared file storage, with careful application design"]
D -->|"No, one instance owns the data"| F{"Must the cluster guarantee only one pod ever uses it?"}
F -->|"Yes"| G["ReadWriteOncePod"]
F -->|"No"| H["ReadWriteOnce"]
Reading Figure 6
Start with the top question: does the application only read the shared data? If yes, the read-only many-node mode fits, with data prepared in advance. If it writes, ask whether many pods on many nodes must write to the same volume. If yes, choose the many-node write mode on shared file storage, and design the application to avoid conflicts. If one instance owns the data, the last question is how strict you must be. When the cluster must guarantee that no second pod ever touches it, choose the single-pod mode. Otherwise the single-node write mode is the simple, well-supported default.
Match the workload shape to the storage
| Workload | Shape | Good fit |
|---|---|---|
| Single database instance | One writer, one copy | RWO, or RWOP for strictness |
| Replicated database with a copy per instance | Each replica owns its own data | A stateful workload with one RWO claim per replica |
| Web servers sharing uploaded files | Many writers, many nodes | RWX on file storage, or move files to object storage |
| Machine-learning inference with one model | Many readers, one dataset | ROX or baking the model into the image |
| Batch jobs sharing a workspace | Many pods, one working area | RWX, with distinct file names per job |
| Stateless service | No persistent data | No persistent volume needed |
Workload types and single-node volumes
The kind of workload object you use decides how gracefully it copes with single-node volumes. A deployment creates interchangeable pods and shares one claim among all of them. That is fine for one copy, and troublesome for several copies on several nodes. A stateful workload is designed for the opposite situation: each replica receives its own claim from a template, so every copy owns private storage. It also starts and stops replicas in an orderly way that respects the single-writer rule.
Use a stateful workload
Give each replica its own claim through a claim template. This is the natural home for databases and queues.
Use the recreate update strategy
For a single-replica deployment with one single-node claim, stop the old pod before starting the new one, at the cost of a short outage.
Pin pods to one node
If several pods must share a single-node volume, make them land on the same node. It works but reduces resilience.
Move to shared storage
If several pods on several nodes truly must share files, choose many-node storage.
Use object storage
For uploads and media, an object store accessed through the application often beats a shared file volume.
Bake data into images
For small read-only data, putting it inside the container image avoids volumes altogether.
If a restaurant has one walk-in freezer with one key, it works well for one head chef. If ten cooks on different floors all need to store food, you either give each cook a personal fridge, build a shared kitchen everyone can enter, or deliver meals from a central warehouse. Each of these solves the sharing problem in a different way.
Before reaching for many-node write storage, ask whether the data really needs to live in a shared folder. Object storage, a database or a message queue are often safer and simpler ways to share data between copies of an application.
11Performance and Availability
The mode you pick shapes both the speed and the recovery time of your application.
Speed
Block disks used with single-node modes are usually fast and predictable. They behave like local drives, with low delay and good throughput for databases. Shared file storage used with many-node modes adds network hops and coordination work, so each operation typically takes longer, and small-file workloads can suffer most. This is why heavy databases usually prefer block storage, even though many-node storage looks more flexible.
Block storage
Low delay, strong for databases and anything needing frequent small reads and writes.
Shared file storage
Fine for large sequential files, slower for many small operations because of coordination.
Local disks
The fastest of all, but tied to one machine, so data is lost or stranded if the machine fails.
Read-only shared data
Reads can be cached heavily on each node, which makes this mode very efficient for reference data.
Availability and recovery
Single-node volumes tie a pod’s recovery speed to the detach process. After an ordinary pod restart on the same node, the volume is simply reused and recovery is fast. After a move to another node, the disk must detach and attach, taking seconds. After a node failure, safety delays may stretch this to minutes. Many-node storage removes the attach problem entirely, since pods on any node can mount the storage, so replacement pods start quickly, at the price of extra network cost and reliance on a shared service.
| Event | Single-node volume | Many-node volume |
|---|---|---|
| Pod restarts on the same node | Fast, volume stays attached | Fast |
| Pod moves to another node | Detach then attach, seconds to a minute | Mount on the new node, quick |
| Node crashes | Waits for safe release, may take minutes | Replacement mounts immediately |
| Zone outage | Volume stuck in the failed zone | Depends on the shared service’s own resilience |
| Rolling update | Risk of waiting or an error if pods land on different nodes | Smooth |
Choosing between speed and recovery in practice
Consider two teams with the same application. The first stores its data on fast single-node block storage and accepts that a node failure may cost several minutes of downtime, while its application replicates data to a standby copy for faster failover. The second stores its data on shared file storage so that any node can restart the pod at once, and accepts slower file operations. Both designs are reasonable. The first suits a busy database, where every millisecond counts and replication is well understood. The second suits a content workflow, where files are large, operations are few, and instant restarts matter more than raw speed. Notice that neither team chose a mode in isolation: each chose a whole design in which the mode, the storage and the application’s own behaviour fit together.
When you compare designs, test with realistic data volumes and failure drills. Pull the plug on a node in a test cluster, measure how long recovery really takes, and see whether the application copes with the delay. Real measurements settle arguments that opinions cannot.
Zones and location
Cloud block disks belong to one zone. A pod using such a disk can only run on nodes in that zone. If that zone has no free capacity or suffers an outage, the pod cannot move elsewhere, and the data stays unreachable until the zone recovers or you restore from a snapshot. Plan snapshots and cross-zone copies for anything important, and consider replicating data at the application level for high availability.
Think of a bank’s private vault versus a shared safe-deposit hall. The vault is faster and more private, but if the building floods, everything is stuck. The shared hall may be a bit slower to reach, but it has staff and procedures that let you get in from many entrances. The choice depends on what you value most.
A single-node claim does not give high availability by itself. If your application must survive a zone or node failure quickly, replicate data at the application layer or choose storage designed for that.
12Advantages, Disadvantages and Trade-offs
Every choice buys something and costs something. Here is an honest ledger of the access mode system and of the modes themselves.
Clear vocabulary
Four short names capture how storage can be shared, understood by developers and administrators alike.
Automatic matching
Kubernetes pairs claims with suitable volumes without human intervention.
Protection from accidents
Refusing double attachment shields file systems from corruption.
Portability of intent
An application states what it needs, not which disk to use, so it moves between clusters easily.
Easy to misread
“Once” means once per node, not once per pod, and this surprises almost everyone at first.
Not a full lock
Modes describe the storage but do not by themselves enforce every safe behaviour.
Driver-dependent
What a mode really means in practice depends on the driver and the storage behind it.
Scheduling friction
Single-node volumes constrain where pods can run and how updates roll out.
Trade-offs in plain words
The first trade-off is safety against flexibility. A single-writer mode is the safest and simplest to reason about, but it limits your application to one node’s worth of writers. Many-node write access is flexible, but it moves the burden of coordination onto your application and your storage.
The second is speed against sharing. Block disks are fast and single-node. Shared file storage is shareable and slower. There is rarely a free lunch, and the best designs place fast single-writer storage under databases and shared storage only where sharing is truly needed.
The third is strictness against compatibility. The single-pod mode gives the strongest guarantee, but it depends on newer versions and driver support. The single-node mode is universally supported but leaves a gap for several pods on the same node. Teams choose based on how much risk they can accept and how modern their platform is.
The fourth is simplicity against resilience. One claim shared by a deployment is easy to write but fragile in updates and failures. A per-replica claim from a template needs more thought but survives real-world events with far less drama.
A single-key locker is very safe, but only one person at a time can fetch their things. A shared cupboard is convenient, but you must trust everyone to keep it tidy. Choosing between them is about how much you trust the users and how badly you need speed and order.
13Monitoring and Troubleshooting
When a pod is stuck on storage, the status and events usually name the cause. Learn the common messages and you can fix most problems in minutes.
Symptoms and where to look
| What you see | Likely meaning | Where to look first |
|---|---|---|
| Claim stays pending | No volume matches size, class or mode, and none can be created | Claim events, storage class, driver capabilities |
| Pod stuck creating with a message that the volume is already attached elsewhere | A single-node volume is attached to another node | Which pod holds the volume, on which node |
| Message about a volume node affinity conflict | The pod is scheduled where the volume cannot be reached | Volume zone or node, pod placement rules |
| Pod cannot write, read-only file system | The volume or the mount is read-only | Claim mode, pod mount setting, file system health |
| Permission denied on files | File ownership does not match the pod’s user | Pod security settings, file ownership |
| Extra replicas pending while one runs | Replicas on other nodes cannot share a single-node volume | Workload type, claim sharing |
| Rollout frozen during update | New pod waits for the volume held by the old one | Update strategy, node placement |
| Long delay after node failure | Safety wait before the volume is released | Node status, attachment records |
A calm troubleshooting routine
First, look at the claim. Is it bound? A pending claim points to matching or creation problems; read its events. Second, look at the pod’s events and status: a message about an attachment, a mount or a scheduling conflict identifies the stage that failed. Third, find out where the volume is attached now and which pod holds it. Fourth, compare the modes: the claim’s requested mode, the volume’s supported modes, and what the driver documents. Fifth, check the pod’s mount settings for read-only flags and the file ownership inside the volume. Sixth, check the storage system itself for health, capacity and zone problems.
Claim
Bound or pending, size and mode requested, and the storage class named.
Volume
Supported modes, capacity, location and current state.
Scheduling
Where the pod was placed and whether placement rules conflict with volume location.
Attachment
Which node holds the volume and whether a safe release is pending.
Mount
Read-only flags, file system errors and ownership.
Storage backend
Health, quotas, zone status and driver logs.
A second worked example: the read-only surprise
A pod starts, but its application logs say it cannot write to its data folder. The claim is bound and the mount succeeded, so the storage stage is fine. The team checks the mount settings in the pod definition and finds a read-only flag left over from a template copied from a reference-data workload. Removing the flag and restarting fixes the problem. A second possible cause would have been a file system that switched itself to read-only after an error, which shows up in the node’s logs. The lesson: when writes fail on a bound and mounted volume, check the mount flag first, the file system health second and file ownership third.
What to monitor all the time
Track claims stuck in a pending state, pods stuck creating because of storage, attach and mount durations, volume capacity used against capacity requested, and driver errors. Alert on claims pending longer than a few minutes and on capacity nearing its limit. Watching attach times over weeks reveals slowly degrading storage before it causes an outage.
A worked example
A team scales a deployment from one replica to three. The first pod runs, and the other two are stuck. The events say the volume is already attached to a different node. All three replicas share one single-node claim, and the scheduler placed the extra pods on other nodes. The team switches to a stateful workload with one claim per replica, and all three start. Reading the message carefully turned an alarming freeze into a five-minute design fix.
When a guest cannot enter a hotel room, a good concierge asks in order: is there a booking, is the room free, is the key coded correctly, is the door jammed? Guessing at the door before checking the booking wastes time. The layered routine is the concierge’s checklist.
Read the exact words of the event message. Storage errors are unusually descriptive, and they typically name the node, the volume and the reason.
14Design Patterns and Anti-patterns
A pattern is a proven way of solving a repeated problem. An anti-pattern is a tempting habit that keeps causing pain.
Patterns worth adopting
One claim per replica
Stateful workloads give each replica private storage through a claim template, avoiding sharing problems entirely.
Read-only shared data
Prepare reference data once, then present it read-only to many pods, at both volume and mount level.
Name storage classes by purpose
Classes such as fast single writer or shared files tell developers what they are getting.
Wait for first consumer
Create disks only when the pod is placed, so zones always line up.
Prefer object storage for shared files
Uploads and media often live better in an object store than on a shared volume.
Test mode support early
Try a real claim and pods on several nodes before committing to a design.
Anti-patterns to avoid
One claim shared by many deployment replicas
A recipe for stuck pods when replicas land on different nodes.
Databases on shared file storage
Coordination limits and locking behaviour make this risky and slow.
Assuming the mode is a lock
Treating a description as a guarantee and skipping application-level coordination.
Requesting more than you need
Asking for many-node write access when one writer would do, and paying in speed and cost.
Ignoring update strategy
Leaving default rolling updates on a single-node claim and being surprised by frozen rollouts.
No backups because it is shared
Sharing storage is not the same as protecting it.
Context
A web application runs six replicas across three nodes. Users upload images, and every replica must be able to serve any image. The team first considered a shared volume.
Options considered
Many-node write access on a shared file service. A single-node volume with all replicas pinned to one node. An object store accessed through the application.
Decision
Store uploads in an object store. Keep the shared file service only for a small legacy report folder that needs many-node access. Reject pinning, because it removes resilience.
Consequences
The application needs a small code change to use the object store. In return, replicas are stateless, scaling is easy, and node failures no longer stall storage. The team keeps regular backups of the object store and of the legacy folder.
An office that lets every employee scribble on a single shared paper diary will soon find pages torn and entries overwritten. A proper shared calendar with entries per person, and a locked cabinet for originals, keeps everyone working without collisions. Good storage design is choosing the calendar over the diary.
15Best Practices and Common Mistakes
This chapter gathers the advice into checklists you can keep beside your desk.
Best practices
Choosing modes
Request the least access you need. Prefer one writer whenever possible. Use read-only whenever an application only reads. Check that your storage class and driver really provide the requested mode.
Workload design
Use stateful workloads with per-replica claims for anything that owns data. For single-replica deployments with single-node claims, choose an update strategy that stops the old pod first. Design applications to tolerate a few minutes of storage recovery after failures.
Safety
Mount read-only where possible. Keep the set of writers small. Encrypt storage. Take regular snapshots and test restores. Never rely on the mode alone for coordination.
Operations
Alert on pending claims, stuck pods and capacity limits. Document which storage classes give which behaviour. Rehearse node-failure recovery in a test cluster.
Common mistakes
| Mistake | Why it hurts | Better approach |
|---|---|---|
| Reading “once” as once per pod | Surprise when several pods on one node share the volume, or when pods on other nodes cannot | Remember it means once per node |
| Sharing one single-node claim among many replicas | Replicas on other nodes stay stuck | Use per-replica claims or shared storage |
| Asking a block-disk class for many-node write access | Claim stays pending or fails | Choose a class backed by shared file storage |
| Default rolling update on a single-node claim | Frozen rollout | Use a recreate strategy or a stateful workload |
| Running a database on shared files | Corruption risk and poor speed | Use block storage for databases |
| Forgetting zone limits of cloud disks | Pod cannot schedule where the disk lives | Wait for first consumer and plan zones |
| Assuming modes protect against every conflict | Two writers still overwrite files | Use locking or separate files per writer |
| Skipping backups | One mistake destroys shared data | Snapshot and test restores |
| Not reading event messages | Long, needless debugging | Read the exact wording first |
A platform guide for your teams
If you run a cluster for other teams, write a one-page storage guide and keep it up to date. It should list each storage class by name, in plain words: what kind of storage it creates, which modes it supports, how fast it is, what it costs, whether it survives a zone failure and whether snapshots are available. Next to the list, give a short decision chart like the one in Chapter 10, and a few sentences on the most common traps, such as sharing a single-node claim among many replicas. Developers who can read a page like this rarely need to ask for help, and administrators spend far less time on stuck-pod tickets.
It also helps to set defaults wisely. Make the default class the safe, common choice, usually single-node block storage created when the pod is placed. Provide shared file storage as a clearly named alternative, so choosing many-node access is a deliberate act rather than an accident. Use quotas to stop a single team from claiming huge amounts of expensive shared storage without a conversation.
Sizing and growing volumes
Access modes do not change how big a volume is, but modes and sizing interact in practice. Single-node block volumes are often resizable while in use, if the driver allows expansion, which makes it easy to start small and grow. Shared file storage may grow automatically or have generous limits, but its cost per unit is often higher. Always leave headroom, watch used capacity, and alert well before a volume fills, because a full volume causes application errors that look like unrelated bugs. Remember that shrinking is rarely supported, so start modestly and grow with evidence.
Whenever you review a storage definition, ask three things: how many writers can there be, what happens on a rolling update, and where will the data physically live?
16Real-World Usage Stories
These generic stories, based on common patterns rather than any specific company, show how the modes play out.
The rollout that would not finish
A team ran a small internal tool with one replica and one disk claim. Every update froze: the new pod waited for the disk, and the old pod waited for the new pod to be ready. The fix was one line, choosing the recreate strategy, accepting a thirty-second pause. The team also wrote a short guide so nobody else lost an afternoon to it.
The scale-up that half worked
A content site scaled from one replica to four and saw only one pod start. The others reported that the volume was attached elsewhere. The site had been storing uploaded files on a single-node disk. The team moved uploads to an object store and made the pods stateless, after which scaling became trivial and the storage question disappeared.
The reference data that everyone read
A machine-learning team had a large model file that dozens of inference pods needed. Copying it into every pod wasted time and space. They prepared the model once on shared storage, presented it read-only to all pods, and saw start-up times fall sharply. Nobody could accidentally change the model in place.
The database on shared files
A team placed a database on shared file storage because it looked convenient. Under load, performance was poor and occasional lock problems appeared. Moving to a single-node block volume with a stateful workload and replication at the database level solved both, and recovery drills became predictable.
The zone that went dark
An application used a zone-bound disk. During a zone outage, the pod could not be rescheduled elsewhere because its disk lived in the failed zone. Recovery required restoring from a snapshot in another zone. The team introduced regular cross-zone snapshots and application-level replication for critical data.
Three worked scenarios: thinking like a designer
Scenario one: a small blog with one database
One database instance, one writer, modest traffic. A single-node volume on a block disk is ideal, with a stateful workload and regular snapshots. Adding shared storage would slow the database and add risk for no benefit.
Scenario two: an image-processing pipeline
Many workers on many nodes read input images and write results to a shared working area. Each worker writes different file names. Shared file storage with many-node write access fits, since the workers avoid conflicts by design. The team still copies final results to an object store and keeps snapshots of the shared area.
Scenario three: a licence server that must never run twice
A legacy licensing service must have exactly one running copy, because two copies would issue duplicate licences. The strictest single-pod mode fits, if the cluster and driver support it. If not, the team uses the single-node mode together with a stateful workload of exactly one replica and clear operational notes, accepting that the guarantee is weaker.
A short mental checklist for new storage
Before writing a claim, pause and walk through a short list. State in one sentence what the data is and who writes it. Count how many pods will write at once and on how many nodes. Decide whether the data is shared reference material that could be read-only. Decide what happens on a rolling update and on a node failure. Check which classes your cluster offers and which modes they support. Decide how you will back up and restore. Finally, decide whether the data could live somewhere simpler, such as object storage. Ten minutes on this list prevents most of the problems in this article.
17Frequently Asked Questions
Quick answers to the questions beginners ask most often.
This post was written without live web research. Please verify version-sensitive details, such as ReadWriteOncePod support and driver behaviour, against the official documentation for your Kubernetes version.
18Summary and Key Takeaways
Let us close the loop, returning to the shared office from the start of this article.
Just as an office needs clear rules about the private locker, the noticeboard and the shared whiteboard, a cluster needs clear rules about its storage. Access modes are those rules. They tell Kubernetes whether a volume may be written by one node, read by many nodes, written by many nodes or claimed by a single pod, and Kubernetes uses that description to match, schedule and attach storage safely.
You met the problem of blindly shared storage, the family of volume, claim and class, and the architecture from claim to attached disk. You followed a volume’s life, studied each mode in depth, saw which storage supports which mode, and learned about security, performance, trade-offs, troubleshooting and the mistakes that trap teams most often.
Snapshots, clones and moving between modes
Because a bound claim’s mode is normally fixed, changing modes is really a migration. The typical path is to take a snapshot of the existing volume, or copy its data with a one-time job, and create a new claim with the desired mode from that snapshot or copy. The application is then switched to the new claim. Snapshots also give a clean way to produce read-only many-node data: prepare the data once on a writable volume, snapshot it, and restore the snapshot into a volume presented read-only to many pods. This pattern keeps the original safe and lets consumers scale without contention.
Rehearse any migration on a copy first, check file ownership and permissions after the move, and plan a short freeze of writes so that no changes are lost between the snapshot and the switch.
Version drift and things to verify
Kubernetes storage changes steadily. The single-pod mode arrived after the original three, and support depends on cluster and driver versions. Driver capabilities, safety delays and default classes differ across platforms and releases. Because this article was written without live web research, treat version-specific statements as a starting point. Before relying on a feature in production, read the documentation for your exact version, try it in a test cluster with pods on more than one node, and record the versions in your team’s notes so upgrades prompt a re-check.
A small glossary to keep nearby
Access mode
A label describing how many nodes or pods may use a volume, and whether they may write.
Persistent volume
A piece of real storage registered in the cluster.
Persistent volume claim
A user’s request for storage of a certain size and mode.
Storage class
A recipe for creating volumes automatically on demand.
Attach
Connecting a volume to a node, like plugging a disk into a computer.
Mount
Making an attached volume appear as a folder inside a container.
Stateful workload
A workload type that gives each replica its own identity and, through a template, its own claim.
Wait for first consumer
A setting that delays volume creation until a pod is scheduled, so the disk lands in the right zone.
Key takeaways
Once means once per node
ReadWriteOnce limits nodes, not pods. For one pod, use ReadWriteOncePod.
Modes are labels, not locks
They guide matching and attachment. Permissions, encryption and application design still matter.
Storage decides what is possible
Block disks are single-node. Shared file services provide many-node access.
Match the workload
Per-replica claims for stateful data, read-only for shared reference data, object storage for shared files.
Mind updates and failures
Single-node volumes affect rollouts and recovery time.
Read the events
Storage messages name the volume, the node and the cause.
List the claims in your own cluster. For each one, note its mode, its workload type and where its data lives. That small review teaches more than any article.