<p>I am currently looking into setting up Kubernetes pods for a project on GCP.</p>

<p>The problem - I need to set a persistent shared volume which will be used by multiple nodes. I need all nodes to be able to read from the volume and only one node must be able to write on the volume. So I need some advice what's the best way to achieve that?</p>

<p>I have checked the Kubernetes documentation and know that <code>GCEPersistentDisks</code> does not support <code>ReadWriteMany</code> but anyway this access mode I think will be an overkill. Regarding the <code>ReadOnlyMany</code> I get that nodes can read from the PV but I don't understand how or what can actually modify the PV in this case. Currently my best bet is setting up NFS with GCE persistent disk.</p>

<p>Also the solution should be able to run on the cloud or on premise. Any advice will be appreciated :)</p>

Svetoslav Petrov
<p>According to official <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes" rel="nofollow noreferrer">documentation</a>:</p>

<blockquote>
  <p>A PVC to PV binding is a one-to-one mapping.</p>
  
  <p>A volume can only be mounted using one access mode at a time, even if
  it supports many. For example, a GCEPersistentDisk can be mounted as
  ReadWriteOnce by a single node or ReadOnlyMany by many nodes, but not
  at the same time.</p>
</blockquote>

<p>So I am afraid that this would be impossible to do it how you described.</p>

<p>However, you may want to try <a href="https://kubernetes.io/docs/tasks/job/coarse-parallel-processing-work-queue/" rel="nofollow noreferrer">task queue</a></p>

<p>Please let me know if that helped.</p>
