A block volume can be accessible in read/write or read-only mode depending on the following controls:
The
accessModes parameter specified in the PVC definition. The parameter lists allowed PVC access modes for any pods mounting the volume. VAST Block CSI Driver supports the following modes:For raw block volumes (
volumeMode: block): ReadOnlyMany (ROX), ReadWriteOnce (RWO), ReadWriteOncePod (RWOP), ReadWriteMany (RWX)Note that the ReadWriteMany (RWX) mode for raw block devices can only be implemented with cluster-aware file systems.
For filesystem volumes (
volumeMode: filesystem): ReadOnlyMany (ROX), ReadWriteOnce (RWO), ReadWriteOncePod (RWOP)
NOTE: See here for a detailed explanation of these access modes.
The
readOnly flag of a pod (set totrueorfalse). This flag lets you restrict access by a particular pod to read-only, which may override the access mode specified by the PVC's accessModes parameter.The
readOnly flag can only be applied for filesystem volumes (volumeMode: filesystem). If set for a raw block volume (volumeMode: block), the driver ignores the flag.
To allow concurrent read access by multiple pods to a raw block volume:
Specify in the PVC:
spec: accessModes: - ReadOnlyMany volumeMode: BlockEnsure that none of the pods has the
readOnly flag set.
To allow read/write access to a raw or filesystem block volume by any one pod on the same node at a time:
Specify in the PVC:
spec: accessModes: - ReadWriteOnce volumeMode: {Block|Filesystem}Ensure that none of the pods has the
readOnly flag set.
To allow concurrent read/write access by multiple pods to the same raw block volume:
Specify in the PVC:
spec: accessModes: - ReadWriteMany volumeMode: BlockEnsure that none of the pods has the
readOnly flag set.
To allow concurrent read/write access to a filesystem volume by multiple pods except one:
Specify in the PVC:
spec: accessModes: - ReadWriteOnce volumeMode: FilesystemSpecify in the pod that is not allowed to write:
spec: containers: volumeMounts: - readOnly: true
To allow read/write access to a raw or filesystem block volume by exactly one pod at a time (cluster-wide):
Specify in the PVC:
spec: accessModes: - ReadWriteOncePod volumeMode: {Block|Filesystem}