<p>there,</p>

<p>According to the doc:</p>

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

<p>I created a PV based on nfs:</p>

<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: tspv01
spec:
  capacity:
    storage: 15Gi
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Recycle
  nfs:
    path: /gpfs/fs01/shared/prod/democluster01/dashdb/gamestop/spv01
    server: 169.55.11.79
</code></pre>

<p>a PVC for this PV:</p>

<pre><code>kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: sclaim
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 15Gi
</code></pre>

<p>After create the PVC bind to the PV:</p>

<pre><code>root@hydra-cdsdev-dal09-0001:~/testscript# kubectl get pvc
NAME      STATUS    VOLUME    CAPACITY   ACCESSMODES   AGE
sclaim    Bound     tspv01    15Gi       RWO           4m
</code></pre>

<p>Then I created 2 PODs using the same PVC:</p>

<p>POD1:</p>

<pre><code>kind: Pod
apiVersion: v1
metadata:
  name: mypodshared1
  labels:
    name: frontendhttp
spec:
  containers:
    - name: myfrontend
      image: nginx
      ports:
        - containerPort: 80
          name: "http-server"
      volumeMounts:
      - mountPath: "/usr/share/nginx/html"
        name: mypd
  volumes:
    - name: mypd
      persistentVolumeClaim:
       claimName: sclaim
</code></pre>

<p>POD2:</p>

<pre><code>kind: Pod
apiVersion: v1
metadata:
  name: mypodshared2
  labels:
    name: frontendhttp
spec:
  containers:
    - name: myfrontend
      image: nginx
      ports:
        - containerPort: 80
          name: "http-server"
      volumeMounts:
      - mountPath: "/usr/share/nginx/html"
        name: mypd
  volumes:
    - name: mypd
      persistentVolumeClaim:
       claimName: sclaim
</code></pre>

<p>After I create the 2 PODs, they are assigned to 2 different nodes. And I can exec into the container, and can read&amp;write in the nfs mounted folder.</p>

<pre><code>root@hydra-cdsdev-dal09-0001:~/testscript# kubectl get pod -o wide
NAME                        READY     STATUS              RESTARTS   AGE       IP            NODE
mypodshared1                1/1       Running             0          18s       172.17.52.7   169.45.189.108
mypodshared2                1/1       Running             0          36s       172.17.83.9   169.45.189.116
</code></pre>

<p>Anybody know why this happened?</p>

<p>The accessModes are dependent upon the storage provider. For NFS they don't really do anything different, but a HostPath should use the modes correctly. </p>

<p>See the following table for all the various options: <a href="http://kubernetes.io/docs/user-guide/persistent-volumes/#access-modes" rel="nofollow noreferrer">http://kubernetes.io/docs/user-guide/persistent-volumes/#access-modes</a></p>
