liveBook · Manning

Readwriteonce

As explained in Kubernetes for Developers

ReadWriteOnce is a persistent-storage access mode that permits a volume to be mounted for read-write use by a single node.

ReadWriteOnce is a persistent-volume access mode for storage mounted with read-write access by one Pod at a time. It suits traditional block storage, such as a database disk, rather than shared file storage. section 9.1.2

Choose the access mode according to how Pods must use the data:

  • Use ReadWriteOnce for a traditional hard-drive-like volume used by one Pod. section 9.1.2
  • Use ReadOnlyMany for existing data mounted read-only by multiple Pods. section 9.1.2
  • Use ReadWriteMany for file storage such as NFS when multiple Pods must read and write concurrently. section 9.1.2

MariaDB PersistentVolumeClaim

A MariaDB Pod mounts a PersistentVolumeClaim at /var/lib/mysql. The claim requests 2 GiB with accessModes set to ReadWriteOnce. With dynamic provisioning, Kubernetes creates a suitable PersistentVolume and binds it to the claim; without it, an administrator must provide a matching PersistentVolume. section 9.1.2

How Kubernetes for Developers covers it

How deep it goes
Defines access-mode choices and claim binding, while deferring StorageClass details to separate treatment.
Examples
Demonstrates a MariaDB Pod requesting 2 GiB and mounting the claim at /var/lib/mysql.
What it assumes
Assumes Pods and persistent storage basics, while introducing claims, volumes, access modes, and dynamic binding through a deployment.
What you can do after
Configure a Kubernetes PersistentVolumeClaim with ReadWriteOnce and verify its bound PersistentVolume using kubectl.
How it connects
Connects PersistentVolumeClaim, PersistentVolume, StorageClass, dynamic provisioning, and block storage.

Also explained in

Compare how 2 books explain readwriteonce →

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.