<p>Cant share a PVC with multiple pods in the GCP (with the GCP-CLI)</p>

<p>When I apply the config with <code>ReadWriteOnce</code> works at once</p>

<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
    name: &lt;name&gt;
    namespace: &lt;namespace&gt;
spec:
    accessModes:
        - ReadWriteMany
    resources:
    requests:
        storage: 50Gi
</code></pre>

<p>But with <code>ReadWriteMany</code> the status hangs on pending</p>

<p>Any ideas?</p>

<p>So it is normal that when you apply the config with <strong>ReadWriteOnce</strong> works at once, that's the rule.</p>

<p><strong>ReadWriteOnce</strong> is the most common use case for Persistent Disks and works as the default access mode for most applications. </p>

<p>GCE persistent disk do not support <strong>ReadWriteMany</strong> !</p>

<p><a href="https://i.stack.imgur.com/8sjgv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8sjgv.png" alt="enter image description here"></a>
Instead of <strong>ReadWriteMany</strong>, you can just use <strong>ReadOnlyMany.</strong>
More information you can find here: <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/readonlymany-disks" rel="nofollow noreferrer">persistentdisk</a>. But as you now result will not be the same as you want.</p>

<p>If you want to share volumes you could try some workarounds:</p>

<p>You can create services.</p>

<p>Your service should look after the data that is related to its area of concern and should allow access to this data to other services via an interface. Multi-service access to data is an anti-pattern akin to global variables in OOP.</p>

<p>If you where looking to write logs, you should have a log service which each service can call with the relevant data it needs to log. Writing directly to a shared disk means that you'd need to update every container if you change your log directory structure or add extra features.</p>

<p>Also try to use <code>high-performance, fully managed file storage</code> for applications that require a file system interface and a shared file system.
More information you can find here: <a href="https://cloud.google.com/filestore/docs/accessing-fileshares" rel="nofollow noreferrer">access-fileshare</a>.</p>
