tezvyn:

What do PersistentVolume accessModes mean?

AI-drafted, machine-checkedSource: interviewintermediate
WHAT IT TESTS

access mode semantics.

OUTLINE

RWO mounts read-write by one node, ROX read-only by many nodes, RWX read-write by many nodes; block storage usually only supports RWO while shared filesystems enable RWX.

WHAT THIS TESTS Whether you understand that access modes describe how many nodes can mount a volume and in what mode, and why the underlying storage technology constrains the options.

A GOOD ANSWER COVERS ReadWriteOnce, RWO, lets the volume be mounted read-write by a single node; multiple Pods on that same node can share it, but no other node can mount it. ReadOnlyMany, ROX, lets many nodes mount the volume read-only simultaneously. ReadWriteMany, RWX, lets many nodes mount it read-write at the same time. The key subtlety is that these are node-scoped, not Pod-scoped. A natural use case for RWO is a single-writer database on an EBS or GCE persistent disk. ROX suits shared, read-only reference data or static web assets served by many replicas. RWX suits a shared content or upload directory consumed by many Pods across nodes. Providers differ because block storage like EBS attaches to one node at a time and cannot coordinate concurrent multi-node writes safely, so it offers RWO and sometimes ROX but not RWX. RWX generally requires a networked or distributed filesystem such as NFS, CephFS, or EFS that handles concurrent access.

COMMON WRONG ANSWERS Reading RWO as one Pod rather than one node. Assuming every backend supports RWX. Confusing access modes with the mount being literally enforced read-only by the kubelet. Thinking ROX and RWX are equivalent.

LIKELY FOLLOW-UPS Why can two Pods share an RWO volume? Which providers offer RWX? What is the newer ReadWriteOncePod mode? How does the access mode affect scheduling?

ONE CONCRETE EXAMPLE A Postgres StatefulSet uses an RWO EBS volume bound to one node, a fleet of frontends mounts an ROX volume of static images, and a media-processing app needs RWX so several Pods across nodes write to a shared EFS directory at once.

Read the original → docs.cloud.google.com

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.