<p>What is the best way to create a persistent volume claim with ReadWriteMany attaching the volume to multiple pods? </p>

<p>Based off the support table in <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes" rel="noreferrer">https://kubernetes.io/docs/concepts/storage/persistent-volumes</a>, GCEPersistentDisk does not support ReadWriteMany natively.</p>

<p>What is the best approach when working in the GCP GKE world? Should I be using a clustered file system such as CephFS or Glusterfs? Are there recommendations on what I should be using that is production ready? </p>

<p>I was able to get an NFS pod deployment configured following the steps here - <a href="https://medium.com/platformer-blog/nfs-persistent-volumes-with-kubernetes-a-case-study-ce1ed6e2c266" rel="noreferrer">https://medium.com/platformer-blog/nfs-persistent-volumes-with-kubernetes-a-case-study-ce1ed6e2c266</a> however it seems a bit hacky and adds another layer of complexity. It also seems to only allow one replica (which makes sense as the disk can't be mounted multiple times) so if/when the pod goes down, my persistent storage will as well.</p>

<p>It's possible now with <a href="https://cloud.google.com/filestore/" rel="noreferrer">Cloud Filestore</a>. </p>

<p>First create a Filestore instance.</p>

<pre class="lang-sh prettyprint-override"><code>gcloud filestore instances create nfs-server
    --project=[PROJECT_ID]
    --zone=us-central1-c
    --tier=STANDARD
    --file-share=name="vol1",capacity=1TB
    --network=name="default",reserved-ip-range="10.0.0.0/29"
</code></pre>

<p>Then create a persistent volume in GKE.</p>

<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: fileserver
spec:
  capacity:
    storage: 1T
  accessModes:
  - ReadWriteMany
  nfs:
    path: /vol1
    server: [IP_ADDRESS]
</code></pre>

<p>[IP_ADDRESS] is available in filestore instance details.</p>

<p>You can now request a persistent volume claim. </p>

<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: fileserver-claim
spec:
  accessModes:
  - ReadWriteMany
  storageClassName: "fileserver"
  resources:
    requests:
      storage: 100G
</code></pre>

<p>Finally, mount the volume in your pod. </p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: my-pod
spec:
  containers:
  - name: my container
    image: nginx:latest
    volumeMounts:
    - mountPath: /workdir
      name: mypvc
  volumes:
  - name: mypvc
    persistentVolumeClaim:
      claimName: fileserver-claim
      readOnly: false
</code></pre>

<p>Solution is detailed here : <a href="https://cloud.google.com/filestore/docs/accessing-fileshares" rel="noreferrer">https://cloud.google.com/filestore/docs/accessing-fileshares</a></p>
