<p>I am mounting an NFS file system directory from my Kubernetes pod, this is the PV yaml:</p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: nfs-jenkins-pv
  namespace: infrastrcuture
spec:
  capacity:
    storage: 8Gi
  accessModes:
    - ReadWriteOnce
  mountOptions:
    - vers=4.0
  nfs:
    server: &quot;192.168.31.2&quot;
    path: &quot;/home/dolphin/data/k8s/monitoring/infrastructure/jenkins&quot;
  persistentVolumeReclaimPolicy: Retain
</code></pre>
<p>and this is my NFS <code>/etc/exports</code> file:</p>
<pre><code>[dolphin@MiWiFi-R4CM-srv ~]$ cat /etc/exports
/ *(rw,fsid=0,sync,insecure_locks,insecure,no_root_squash)
/home/dolphin/data/k8s/monitoring/infrastructure/jenkins *(rw,fsid=1000,sync,insecure_locks,insecure,no_root_squash)
</code></pre>
<p>why the nfs server give me tips <code>No such file or directory</code>? what should I do to fix? this is the full error log:</p>
<pre><code>MountVolume.SetUp failed for volume &quot;nfs-jenkins-pv&quot; : mount failed: exit status 32 Mounting command: systemd-run Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/pods/fbbd2507-3c3b-49fa-a646-46748290f007/volumes/kubernetes.io~nfs/nfs-jenkins-pv --scope -- mount -t nfs -o vers=4.0 192.168.31.2:/home/dolphin/data/k8s/monitoring/infrastructure/jenkins /var/lib/kubelet/pods/fbbd2507-3c3b-49fa-a646-46748290f007/volumes/kubernetes.io~nfs/nfs-jenkins-pv Output: Running scope as unit: run-rde3824064fc74a3c91262071353346d3.scope mount.nfs: mounting 192.168.31.2:/home/dolphin/data/k8s/monitoring/infrastructure/jenkins failed, reason given by server: No such file or directory
</code></pre>

Dolphin
<p>I define my <code>/etc/exports</code> file like this:</p>
<pre><code>[dolphin@MiWiFi-R4CM-srv alertmanager]$ cat /etc/exports
/home/dolphin/data/k8s *(rw,fsid=0,sync,insecure_locks,insecure,no_root_squash)
/home/dolphin/data/k8s/infrastructure/jenkins *(rw,fsid=1000,sync,insecure_locks,insecure,no_root_squash)
/home/dolphin/data/k8s/monitoring/alertmanager *(rw,fsid=1001,sync,insecure_locks,insecure,no_root_squash)
</code></pre>
<p>and the PV yaml like this:</p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: nfs-jenkins-pv
  namespace: infrastrcuture
spec:
  capacity:
    storage: 8Gi
  accessModes:
    - ReadWriteOnce
  mountOptions:
    - vers=4.0
  nfs:
    server: &quot;192.168.31.2&quot;
    path: &quot;/infrastructure/jenkins&quot;
  persistentVolumeReclaimPolicy: Retain
</code></pre>
<p>works.</p>
