nfs-ganesha-server-and-external-provisioner: Timeout when Pods try to mount volumes referencing PVCs of storageClass `nfs` on K3D cluster

Problem: I am trying to get nfs-server-provisioner to work in K3D. PVCs and PVs are handled correctly, but Pods cant mount the volume referenced by a PVC. I created an example to make it easy to reproduce the issue in a GitRepo: https://github.com/tricky42/k3d-nfs with a more detailed description.

In this setup the local-path provider from K3D is used to provide the PV for the NFS server automatically through the PVC issued by the nfs-server-provisioner. PVCs of storage class nfs can be provisioned (status: bound), but still pods trying to mount volumes which reference a PVC of storageClass nfs(in this example the PVC nfs-for-pods) are not starting up due to:

MountVolume.SetUp failed for volume "pvc-52c0d57a-b285-45b6-b04c-41175604b0d0" : mount failed: exit status 255
Mounting command: mount Mounting arguments: -t nfs -o vers=3 10.43.192.199:/export/pvc-52c0d57a-b285-45b6-b04c-
41175604b0d0 /var/lib/kubelet/pods/c9e21798-76ad-404d-b089-c9fff88e0a86/volumes/kubernetes.io~nfs/pvc-
52c0d57a-b285-45b6-b04c-41175604b0d0 Output: mount: mounting 10.43.192.199:/export/pvc-52c0d57a-b285-45b6-
b04c-41175604b0d0 on /var/lib/kubelet/pods/c9e21798-76ad-404d-b089-c9fff88e0a86/volumes/kubernetes.io~nfs/pvc-
52c0d57a-b285-45b6-b04c-41175604b0d0 failed: Connection refused

Unable to attach or mount volumes: unmounted volumes=[nfs-mount], unattached volumes=[nfs-mount default-token
-t7qxd]: timed out waiting for the condition

To quickly reproduce this, just enter:

$ make all

So far I couldnt find out, why the Pod cant mount the volume managed by the nfs server 😦

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 16 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Ok so for me, I’ve solved this issue by adding the flags below at the values.yaml (helm chart), mountOptions.

 mountOptions:
    - tcp
    - nfsvers=4.1

@tricky42 Can you try with these flags on your environment?