<p>I have a Kubernetes v1.17.0 cluster with multiple nodes. I've created PVC with access mode set to RWO. From the Kubernetes docs:</p>

<blockquote>
  <p>ReadWriteOnce -- the volume can be mounted as read-write by a single node</p>
</blockquote>

<p>I'm using a Cinder volume plugin which doesn't support ReadWriteMany.</p>

<p>When I create two different deployments that mount the same PVC Kubernetes sometimes deploys them on two different nodes which cause pods to fail. </p>

<p>Is this desired behaviour or is there a problem in my configuration?</p>

<p>As I gathered from your answers to the comments, you do not want to use affinity rules but want the scheduler to perform this work for you.</p>

<p>It seems that this issue has been known since at least 2016 but has not yet been resolved, as the scheduling is considered to be working as expected: <a href="https://github.com/kubernetes/kubernetes/issues/26567" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/26567</a></p>

<p>You can read the details in the issue, but the core problem seems to be that in the definition of Kubernetes, a <code>ReadWriteOnce</code> volume can never be accessed by two Pods at the same time. By definition. What would need to be implemented is a flag saying "it is OK for this RWO volume to be accessed by two Pods at the same time, even though it is RWO". But this functionality has not been implemented yet.</p>

<p>In practice, you can typically work around this issue by using a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#recreate-deployment" rel="nofollow noreferrer">Recreate Deployment Strategy</a>: <code>.spec.strategy.type: Recreate</code>. Alternatively, use the affinity rules as described by the other answers.</p>
