3

I understand what the accessModes individually do, but I was surprised to see that the configuration section for accessModes is an array, rather than a simple key-value. The documentation is far from clear, and as far as I can tell doesn't even mention having more than one.

What does it mean for a PersistentVolumeClaim to specify more than one AccessMode?

Jonas
  • 121,568
  • 97
  • 310
  • 388
TREE
  • 1,292
  • 2
  • 12
  • 21

1 Answers1

4

A persistent volume can be mounted by multiple pods on the different nodes at the same. One pod can mount a persistent volume with only one access mode at a time and other pods can mount the same persistent volume with different access modes. But a pod can mount the persistent volume with only one access mode.

For more, you may read this explanation.

Wytrzymały Wiktor
  • 11,492
  • 5
  • 29
  • 37
Vikas Rathore
  • 8,242
  • 8
  • 35
  • 54
  • The linked doc explains why a PersistentVolume might have multiple accessModes, but not a PersistentVolumeClaim. None of this (doc or answer) seems to explain what it means to have multiple accessModes on a single PersistentVolumeClaim. – TREE Sep 25 '20 at 15:36
  • There is a good answer here that maybe didn't get read because it's super long, but I think it answers your question?https://stackoverflow.com/questions/60248790/why-can-you-set-multiple-accessmodes-on-a-persistent-volume#:~:text=in%20the%20title%3A-,Why%20can%20you%20set%20multiple%20accessModes%20on%20a%20persistent%20volume,are%20access%20modes%20it%20supports. – Howard_Roark Sep 25 '20 at 16:52
  • Eventually, maybe it did, although it was mostly about the Volumes. The short version seems to be that a PersistentVolume will only be created for a PVC if it can satisfy *all* of a PVCs accessModes, that is the accessModes of the PV must be a superset of the accessModes of the PVC? – TREE Sep 25 '20 at 17:24