<p>I need to run pods on multiple nodes with very large (700GB) readonly dataset in Kubernetes. I tried using readonlymany, but it fails in multi-node setup, and in general was very unstable.</p>

<p>Is there a way for pods to create a new persistent disk from a snapshot, attach it to the pod, and destroy it when pod is destroyed?  This would allow me to update snapshots once in a while with the new data.</p>

Yuri Astrakhan
<p>You can manually provision a persistent disk using an existing image on GCP:</p>

<pre><code>gcloud beta compute disks create --size=500GB --image=&lt;snapshot-name&gt;  my-data-disk
</code></pre>

<p>Then use it on your pod:</p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: test-pd
spec:
  containers:
  - image: k8s.gcr.io/test-webserver
    name: test-container
    volumeMounts:
    - mountPath: /test-pd
      name: test-volume
  volumes:
  - name: test-volume
    # This GCE PD must already exist.
    gcePersistentDisk:
      pdName: my-data-disk
      fsType: ext4
</code></pre>

<p>The GCE storage class doesn't support snapshots so unfortunately, you can't do it with PVCs. More info <a href="https://kubernetes.io/docs/concepts/storage/storage-classes/#gce" rel="nofollow noreferrer">here</a></p>

<p>Hope it helps.</p>
