2 min read

[k8s] Finally a volume access mode that makes sense: ReadWriteOncePod

ReadWriteOnce, ReadOnlyMany, ReadWriteMany access modes don't make much sense IMO, new ReadWriteOncePod does
[k8s] Finally a volume access mode that makes sense: ReadWriteOncePod

Kubernetes persistent volume has had, until 1.29 version, the following access modes available:

  • ReadWriteOnce
  • ReadOnlyMany
  • ReadWriteMany

They have all a thing in common, they all reference to the worker node unit.
For example, ReadWriteOnce means

the volume can be mounted as read-write by a single node. ReadWriteOnce access mode still can allow multiple pods to access the volume when the pods are running on the same node. For single pod access, please see ReadWriteOncePod.

And since Kubernetes wants to abstract the concept of computation under the hood, they all don't make much sense.

via GIPHY

But finally, since v1.29 a new access mode has reached the stability..

ReadWriteOncePod finally allow us to make a more fine-grained configuration which meets more the real world needs.

ReadWriteOncePod

apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv0003
spec:
  capacity:
    storage: 5Gi
  accessModes:
    - ReadWriteOncePod
  nfs:
  ...

Some useful references

Persistent Volumes
This document describes persistent volumes in Kubernetes. Familiarity with volumes, StorageClasses and VolumeAttributesClasses is suggested. Introduction Managing storage is a distinct problem from managing compute instances. The PersistentVolume subsystem provides an API for users and administrator…
kubernetes/CHANGELOG/CHANGELOG-1.29.md at master · kubernetes/kubernetes
Production-Grade Container Scheduling and Management - kubernetes/kubernetes
Tweets by YBacciarini