<p>I have a disk image with mirrors of some protein databases (HHsearch, BLAST, PDB, etc.) That I build with some CI tooling, and write to a GCE disk to run against. I'd like to access this <code>ReadOnlyMany</code> PV in <code>Pods</code> created by <code>ReplicationControllers</code> in multiple namespaces via <code>PersistentVolumeClaims</code> but I'm not getting the expected result.</p>

<p>The PersistentVolume configuration looks like this;</p>

<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: "databases"
spec:
  capacity:
    storage: 500Gi
  accessModes:
    - ReadOnlyMany
  persistentVolumeReclaimPolicy: Retain
  gcePersistentDisk:
    pdName: "databases-us-central1-b-kube"
    fsType: "ext4"
</code></pre>

<p>How it looks when loaded into kubernetes;</p>

<pre><code>$ kubectl describe pv
Name:       databases
Labels:     &lt;none&gt;
Status:     Bound
Claim:      production/databases
Reclaim Policy: Retain
Access Modes:   ROX
Capacity:   500Gi
Message:
Source:
    Type:   GCEPersistentDisk (a Persistent Disk resource in Google Compute Engine)
    PDName: databases-us-central1-b-kube
    FSType: ext4
    Partition:  0
    ReadOnly:   false
</code></pre>

<p>The PVC configurations are all identical, and look like this;</p>

<pre><code>kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: databases
spec:
  accessModes:
    - ReadOnlyMany
  resources:
    requests:
      storage:
  volumeName: databases
</code></pre>

<p>And the <code>PVC</code>s as they look in the system;</p>

<pre><code>$ for ns in {development,staging,production}; do kubectl describe --namespace=$ns pvc; done
Name:       databases
Namespace:  development
Status:     Pending
Volume:     databases
Labels:     &lt;none&gt;
Capacity:   0
Access Modes:


Name:       databases
Namespace:  staging
Status:     Pending
Volume:     databases
Labels:     &lt;none&gt;
Capacity:   0
Access Modes:


Name:       databases
Namespace:  production
Status:     Bound
Volume:     databases
Labels:     &lt;none&gt;
Capacity:   0
Access Modes:
</code></pre>

<p>I'm seeing lots of <code>timeout expired waiting for volumes to attach/mount for pod "mypod-anid""[namespace]". list of unattached/unmounted volumes=[databases]</code> when I do <code>$ kubectl get events --all-namespaces</code></p>

<p>When I scale the RC 1->2 in production (where one pod <em>did</em> manage to bind the PV), the second Pod fails to mount the same PVC. When I create a second <code>ReplicationController</code> and <code>PersistentVolumeClaim</code> in my production namespace (recall that this is where the pod that successfully mounted the pv lives) backed by the same <code>PersistentVolume</code>, the second Pod/PVC cannot bind.</p>

<p>Am I missing something? How is one supposed to actually <em>use</em> an ROX <code>PersistentVolume</code> with <code>PersistentVolumeClaim</code>s?</p>

<p>A single PV can only be bound to a single PVC at a given time, regardless of whether it is ReadOnlyMany or not (once a PV/PVC binds, the PV can't bind to any other PVC).</p>

<p>Once a PV/PVC is bound, ReadOnlyMany PVCs may be referenced from multiple pods. In Peter's case, however, he can't use a single PVC object since he is trying to refer to it from multiple namespaces (PVCs are namespaced while PV objects are not).</p>

<p>To make this scenario work, create multiple PV objects that are identical (referring to the same disk) except for the name. This will allow each PVC object (in all namespaces) to find a PV object to bind to.</p>
