Access modes

A persistent volume can be mounted on a host in any way supported by the resource provider. Providers have different capabilities and each PV’s access modes are set to the specific modes supported by that particular volume. For example, NFS can support multiple read/write clients, but a specific NFS PV might be exported on the server as read-only. Each PV gets its own set of access modes describing that specific PV’s capabilities.

Claims are matched to volumes with similar access modes. The only two matching criteria are access modes and size. A claim’s access modes represent a request. Therefore, you might be granted more, but never less. For example, if a claim requests RWO, but the only volume available is an NFS PV (RWO+ROX+RWX), the claim would then match NFS because it supports RWO.

Direct matches are always attempted first. The volume’s modes must match or contain more modes than you requested. The size must be greater than or equal to what is expected. If two types of volumes, such as NFS and iSCSI, have the same set of access modes, either of them can match a claim with those modes. There is no ordering between types of volumes and no way to choose one type over another.

All volumes with the same modes are grouped, and then sorted by size, smallest to largest. The binder gets the group with matching modes and iterates over each, in size order, until one size matches.

Important

Volume access modes describe volume capabilities. They are not enforced constraints. The storage provider is responsible for runtime errors resulting from invalid use of the resource. Errors in the provider show up at runtime as mount errors.

For example, NFS offers ReadWriteOnce access mode. If you want to use the volume’s ROX capability, mark the claims as ReadOnlyMany.

iSCSI and Fibre Channel volumes do not currently have any fencing mechanisms. You must ensure the volumes are only used by one node at a time. In certain situations, such as draining a node, the volumes can be used simultaneously by two nodes. Before draining the node, delete the pods that use the volumes.

The following table lists the access modes:

Table 6. Access modes
Access Mode CLI abbreviation Description

ReadWriteOnce

RWO

The volume can be mounted as read/write by a single node.

ReadWriteOncePod

RWOP

The volume can be mounted as read/write by a single pod on a single node.

ReadOnlyMany

ROX

The volume can be mounted as read-only by many nodes.

ReadWriteMany

RWX

The volume can be mounted as read/write by many nodes.

Table 7. Supported access modes for persistent volumes
Volume plugin ReadWriteOnce [1] ReadWriteOncePod ReadOnlyMany ReadWriteMany

AWS EBS [2]

AWS EFS

Azure File

Azure Disk

CIFS/SMB

Cinder

Fibre Channel

[3]

GCP Persistent Disk

[4]

[4]

GCP Filestore

HostPath

IBM Power Virtual Server Disk

IBM Cloud® VPC Disk

iSCSI

[3]

Local volume

LVM Storage

NFS

OpenStack Manila

Red Hat OpenShift Data Foundation

VMware vSphere

[5]

  1. ReadWriteOnce (RWO) volumes cannot be mounted on multiple nodes. If a node fails, the system does not allow the attached RWO volume to be mounted on a new node because it is already assigned to the failed node. If you encounter a multi-attach error message as a result, force delete the pod on a shutdown or crashed node to avoid data loss in critical workloads, such as when dynamic persistent volumes are attached.

  2. Use a recreate deployment strategy for pods that rely on AWS EBS.

  3. Only raw block volumes support the ReadWriteMany (RWX) access mode for Fibre Channel and iSCSI. For more information, see "Block volume support".

  4. For GCP hyperdisk-balanced disks:

    • The supported access modes are:

      • ReadWriteOnce

      • ReadWriteMany

    • Cloning and snapshotting is disabled for disks with ReadWriteMany access mode enabled.

    • You can attach a single hyperdisk-balanced disk volume in ReadWriteMany to a maximum of 8 instances.

    • You can only resize a disk in ReadWriteMany if you detach the disk from all instances.

    • For additional limitations, see Google Cloud documentation "GCP hyperdisk-balanced disk additional limitations".

  5. If the underlying vSphere environment supports the vSAN file service, the vSphere Container Storage Interface (CSI) Driver Operator installed by OpenShift Container Platform supports provisioning of ReadWriteMany (RWX) volumes. If you do not have vSAN file service configured, and you request RWX, the volume fails to get created and an error is logged. For more information, see "VMware vSphere CSI Driver Operator".