<p>I have a statefulSet that has a VolumeClaim.</p>

<p>The volume section of <strong>StatefulSet1</strong> is </p>

<pre><code>  volumes:
  - name: artifact
    persistentVolumeClaim:
      claimName: artifacts
</code></pre>

<p>The PVC definition is</p>

<pre><code>kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: artifacts
spec:
  accessModes:
    - "ReadWriteOnce"
  resources:
    requests:
      storage: "5Gi"
  storageClassName: default
</code></pre>

<p>Now when I spin up StatefulSet1, everything is ok. The pod get the claim and is successfully mounted.</p>

<p>Now I want to bring up another Stateful set i.e. StatefulSet2 which needs to attach to the PV.</p>

<p>So my volume section of <strong>StatefulSet2</strong> is the same.</p>

<pre><code>  volumes:
  - name: artifact
    persistentVolumeClaim:
      claimName: artifacts
</code></pre>

<p>But when I spin up StatefulSet2, my original PVC goes into terminating state.</p>

<pre><code>kubectl get pvc artifacts
NAME                STATUS        VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
artifacts           Terminating   pvc-b55f729d-e115-11e8-953e-02000a1bef39   5Gi       RWO            rbd-mario      31m
</code></pre>

<p>And the new pod is continuously in Pending state.</p>

<p>Not sure what Im doing wrong here. But my aim is to connect multiple StatefulSets/Pods to the same PV.</p>

<blockquote>
  <p>The <strong>accessMode</strong> for this PVC is set to <strong>ReadWriteMany</strong> so the kubernetes
  allows mounting this PVC on multiple pods</p>
</blockquote>

<p><a href="https://docs.portworx.com/scheduler/kubernetes/shared-volumes.html" rel="nofollow noreferrer">https://docs.portworx.com/scheduler/kubernetes/shared-volumes.html</a></p>

<p><a href="https://docs.okd.io/latest/install_config/storage_examples/shared_storage.html" rel="nofollow noreferrer">https://docs.okd.io/latest/install_config/storage_examples/shared_storage.html</a></p>

<p>More likely this should work:</p>

<pre><code>kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: artifacts
spec:
  accessModes:
    - "ReadWriteMany"
  resources:
    requests:
      storage: "5Gi"
  storageClassName: default
</code></pre>
