<p>My GKE deployment consists of N pods (possibly on different nodes) and a shared volume, which is <a href="https://kubernetes.io/docs/concepts/storage/dynamic-provisioning/" rel="nofollow noreferrer">dynamically provisioned</a> by <code>pd.csi.storage.gke.io</code> and is a Persistent Disk in GCP. I need to initialize this disk with data before the pods go live.</p>
<p>My problem is I need to set <code>accessModes</code> to <code>ReadOnlyMany</code> and be able to mount it to all pods across different nodes in read-only mode, which I assume effectively would make it impossible to mount it in write mode to the <code>initContainer</code>.</p>
<p>Is there a solution to this issue? <a href="https://stackoverflow.com/questions/57754103/how-to-pre-populate-a-readonlymany-persistent-volume">Answer to this question</a> suggests a good solution for a case when each pod has their own disk mounted, but I need to have one disk shared among all pods since my data is quite large.</p>

Leonid Bor
<p><code>...I need to have one disk shared among all pods</code></p>
<p>You can try Filestore. First your create a FileStore <a href="https://cloud.google.com/filestore/docs/creating-instances" rel="nofollow noreferrer">instance</a> and save your data on a FileStore volume. Then you <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/persistent-volumes/filestore-csi-driver#enabling_the_on_a_new_cluster" rel="nofollow noreferrer">install</a> FileStore driver on your cluster. Finally you share the data with pods that needs to read the data using a PersistentVolume <a href="https://github.com/kubernetes-sigs/gcp-filestore-csi-driver/blob/master/examples/kubernetes/pre-provision/preprov-pv.yaml" rel="nofollow noreferrer">referring</a> the FileStore instance and volume above.</p>
