liveBook · Manning

Access mode

As explained in Kubernetes for Developers

An access mode specifies how and by how many Pods a persistent volume may be mounted for reading and writing.

An access mode specifies how a persistent volume can be mounted and how many Pods can read or write it. A PersistentVolumeClaim declares the desired mode. section 9.1.2

Choose the mode according to the storage workload:

  • ReadWriteOnce mounts traditional block storage for read/write access from a single Pod and is the common choice for stateful applications. section 9.1.2
  • ReadOnlyMany mounts existing data read-only across multiple Pods. section 9.1.2
  • ReadWriteMany allows multiple Pods to read and write simultaneously, typically with file storage such as NFS; only some storage drivers support it. section 9.1.2

MariaDB on a persistent disk

A MariaDB Pod mounts its claim at /var/lib/mysql. The claim requests 2 GiB with ReadWriteOnce, allowing a dynamically provisioned disk-backed PersistentVolume to bind to it.

How Kubernetes for Developers covers it

How deep it goes
Defines three access modes and their storage implications, but defers provisioning behavior to StorageClass configuration.
Examples
Uses a MariaDB Pod with a 2 GiB ReadWriteOnce claim mounted at /var/lib/mysql.
What you can do after
Configure a PersistentVolumeClaim with an access mode suited to the workload's Pod count and storage type.
How it connects
Connects PersistentVolumeClaim, PersistentVolume, StorageClass, dynamic provisioning, and persistent storage.

Also explained in

Compare how 3 books explain access mode →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes for Developers. The section links point to the parts of the book it draws on.