What do PersistentVolume accessModes mean?
access mode semantics.
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's really being asked
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.
The full answer
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.
The mistakes people make
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.
What usually comes next
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?
A 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.
Interview question
Why can a typical block-storage provider like EBS not offer ReadWriteMany?
- a.Kubernetes forbids RWX on cloud providers
- b.A single block device cannot safely be written by multiple nodes at onceCorrect
- c.Block devices are too slow for multiple readers
- d.ReadWriteMany requires encryption that EBS lacks
Why? this is the answer
Block storage attaches to one node and has no mechanism to coordinate concurrent multi-node writes, so RWX needs a shared filesystem like NFS or EFS. Speed, a Kubernetes ban, and encryption are not the limiting factors.
Just read this? Test yourself on what you have been reading.
Read the original → docs.cloud.google.com
- #kubernetes
- #accessmodes
- #persistentvolume
- #storage
- #rwx
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on kubernetes — each one lists the topics its interview covers.
See open roles