Access modes and topology
Access modes answer different questions
Access modes describe the access patterns a volume offers. ReadWriteOnce (RWO) means a volume can be mounted read-write on one node; more than one Pod on that node can still use it. ReadOnlyMany (ROX) describes multi-node read-only access. ReadWriteMany (RWX) describes multi-node read-write access. ReadWriteOncePod (RWOP) restricts access to one Pod across the cluster; it is stable since Kubernetes 1.29 and requires compatible CSI components. Drivers do not all implement every mode. Choose based on the workload and actual backend support.
Access mode is not application locking
Two catalog writers on the same node could both use an RWO claim. That does not make concurrent writes safe. Use application-level coordination or a database designed for concurrent access. Even RWX does not guarantee atomic operations or consistent application data. ROX by itself is not a universal enforcement mechanism for write protection. Request a read-only mount explicitly where appropriate and enforce storage backend permissions as well. This read-only Pod references the same claim within its namespace.
apiVersion: v1kind: Podmetadata: name: catalog-reader namespace: storage-studyspec: automountServiceAccountToken: false nodeSelector: topology.kubernetes.io/zone: study-a containers: - name: reader image: example.invalid/bytemind/catalog:study resources: requests: cpu: 50m memory: 32Mi limits: cpu: 100m memory: 64Mi volumeMounts: - name: data mountPath: /data readOnly: true volumes: - name: data persistentVolumeClaim: claimName: catalog-data readOnly: trueFilesystem versus raw block
Filesystem is the usual volumeMode and is the default when omitted. The container uses a directory through volumeMounts. Block mode exposes a raw device through volumeDevices and devicePath; the application must know how to use it. A Block PV cannot satisfy a Filesystem PVC merely because the capacity matches. Do not format devices on a real host for this tutorial. The offline fixtures use only synthetic metadata, not disk devices.
A disk has a location
Suppose the catalog Pod requires zone study-b, but the only existing compatible PV has node affinity for study-a. Its capacity and access mode alone are not sufficient. There is no node satisfying both zone constraints, so scheduling cannot proceed. The PV in pv.yaml lists its allowed topology. A local volume is similarly tied to its node. A volume may remain unavailable if that node or zone fails; persistence does not imply cross-zone availability.
Choose the binding moment
Immediate binding or provisioning begins with the claim and may choose storage before knowing the Pod location. WaitForFirstConsumer delays the decision so that the scheduler can consider storage and workload constraints together, when the driver supports it. For the fictional class, a consumer requiring study-a can select an eligible existing PV in that zone. A real provisioner might instead create appropriate storage there if supported and available. This is not a promise of capacity. Avoid setting spec.nodeName for delayed binding: it bypasses normal scheduling. A nodeSelector expresses the intended constraint without that bypass.
Practice with two zones
Use topology-cases.json to intersect candidate Pod zones and PV zones. Then use access-cases.json to reason about same-node versus cross-node use and one-Pod restrictions. These cases assume drivers support the requested modes, and ignore attachment limits, taints, CPU capacity and other scheduling rules unless explicitly stated. In a real diagnostic, inspect Pod events, PV node affinity, PVC status and driver events. Do not loosen a storage restriction merely to make a Pod run.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Access modes and topology — knowledge check
Reason about persistent storage using synthetic Kubernetes examples.
Two Pods on one node share an RWO volume. Is that necessarily disallowed?
Which mode is designed for one Pod across the cluster?
A Pod needs study-b and the only bound PV allows study-a. What is the result?
Which Pod field connects a filesystem volume to a directory?
Why use WaitForFirstConsumer for topology-constrained storage?