<p>I know there are lots of discussions round this topic but somehow, I can not get it working.<br>
I am trying to install elastic search cluster with statefulset and nfs persistent volume on bare metal. My pv, pvc and sc configs are as below:</p>

<pre><code>kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: manual
provisioner: kubernetes.io/no-provisioner
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: nfs-storage-pv
spec:
  capacity:
    storage: 10Gi
  accessModes:
  - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  storageClassName: manual
  nfs:
    server: 172.23.240.85
    path: /servers/scratch50g/vishalg/kube
</code></pre>

<p>Statefuleset has following pvc section defined:</p>

<pre><code>volumeClaimTemplates:
  - metadata:
      name: beehive-pv-claim
    spec:
      accessModes: [ "ReadWriteOnce" ]
      storageClassName: manual
      resources:
        requests:
          storage: 1Gi
</code></pre>

<p>Now, when I try to deploy it, I get the following error on statefulset:</p>

<pre><code> pod has unbound immediate PersistentVolumeClaims 
</code></pre>

<p>When I get the pvc events, it shows:</p>

<pre><code> Warning  ProvisioningFailed  3s (x2 over 12s)  persistentvolume-controller  no volume plugin matched
</code></pre>

<p>I tried not giving any storageclass (did not create it) and removed it from pv and pvc both altogether. This time, I get below error:</p>

<pre><code>no persistent volumes available for this claim and no storage class is set
</code></pre>

<p>I also tried setting storageclass as "" in pvc and not mention it in pv, but it did not work also.  </p>

<p>Please help here. What can I check more to get it working?<br>
Can it be related to nfs server and path (if by chance, it is mentioned incorrectly), though I see pv created successfully.</p>

<p><strong>EDIT1</strong>:<br>
One issue was that accessmode of pvc was different from accessmode of pv. I got it corrected and now my pvc is shown as bound.<br>
But now even, I get following error:<br>
     pod has unbound immediate PersistentVolumeClaims 
I tried using local volume also but again same error. PV and PVC are bound correctly but statefulset shows above error.<br>
When using hostPath volume, everything works fine.<br>
Is anything fundamentally that I am doing wrong here?</p>

<p><strong>EDIT2</strong><br>
I got the local volume working. It takes some time to pod to bind to pvc. After waiting for coupl eof minutes, my pod got bind to pvc.<br>
I think, nfs binding issue can be more of permission related. But still, k8s  should give out some error for the same.</p>

<p>Could you try matching the accessModes as well?</p>

<p>The PVC is targeting a ReadWriteOnce volume right now.</p>

<p>And if you mount the nfs volume on the node manually, any access/security issue can be debugged.</p>
