Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set up an NFS server on a node in a kind cluster with overlayfs? #3842

Open
ace0527 opened this issue Jan 12, 2025 · 4 comments
Open
Labels
kind/support Categorizes issue or PR as a support question.

Comments

@ace0527
Copy link

ace0527 commented Jan 12, 2025

I created a local kind cluster with two nodes on my macOS. I want to use one of the nodes (named as worker1) as an NFS server. On worker1, I installed the NFS-related components:

ii  libnfsidmap1:amd64            1:2.6.2-4+deb12u1              amd64        NFS idmapping library
ii  nfs-common                    1:2.6.2-4+deb12u1              amd64        NFS support files common to client and server
ii  nfs-kernel-server             1:2.6.2-4+deb12u1   

Then I exported the /mnt/nfs directory as an NFS directory:

# mkdir -p /mnt/nfs
# echo '/mnt/nfs *(rw,sync,no_subtree_check)' >> /etc/exports
# exportfs -a

However, I encountered an error when executing exportfs -a: the /mnt/nfs directory does not support NFS export.

exportfs: /mnt/nfs does not support NFS export

I found some information from internet indicating that NFS does not support the overlay file system, so I checked the file system type of the /mnt/nfs directory:

df -T /mnt/nfs
Filesystem     Type    1K-blocks     Used Available Use% Mounted on
overlay        overlay  61202244 23181440  34879480  40% /

It seems that the /mnt/nfs directory does not support NFS because its file system type is overlay.
So my questions are:

  1. I don't know why the file system type of the /mnt/nfs directory is overlay. Does this have something to do with Docker's mechanism or the fact that I am using macOS?
  2. As for the solution, is it enough to change the file system type of the /mnt/nfs directory to a type that NFS supports? How can I change the file system type of /mnt/nfs?"
@ace0527 ace0527 added the kind/support Categorizes issue or PR as a support question. label Jan 12, 2025
@aojea
Copy link
Contributor

aojea commented Jan 13, 2025

It seems there are several tutorials out there using nfs succesfully, per example https://cloudyuga.guru/blogs/nfs-kind/, can you try following one of those and report back?

@ace0527
Copy link
Author

ace0527 commented Jan 13, 2025

It seems there are several tutorials out there using nfs succesfully, per example https://cloudyuga.guru/blogs/nfs-kind/, can you try following one of those and report back?

I tried the methods mentioned on the website, but they all failed due to overlayfs(just like mentioned in these two issues: nfs-ganesha/issues/511 , nfs-ganesha-server-and-external-provisioner/issues/45. I will later experiment on a Linux virtual machine instead of my macOS system to see if there will be different results.

@BenTheElder
Copy link
Member

you can mount a path with https://kind.sigs.k8s.io/docs/user/configuration/#extra-mounts, so the filesystem is something else

https://github.com/kubernetes-sigs/nfs-ganesha-server-and-external-provisioner is testing with kind, and doesn't appear to be using any extra mounts though. AFAIK overlayfs can support nfs export: https://docs.kernel.org/filesystems/overlayfs.html#nfs-export

but this depends on the host.

@ace0527
Copy link
Author

ace0527 commented Jan 14, 2025

you can mount a path with https://kind.sigs.k8s.io/docs/user/configuration/#extra-mounts, so the filesystem is something else

https://github.com/kubernetes-sigs/nfs-ganesha-server-and-external-provisioner is testing with kind, and doesn't appear to be using any extra mounts though. AFAIK overlayfs can support nfs export: https://docs.kernel.org/filesystems/overlayfs.html#nfs-export

but this depends on the host.

Thank you for the info. I will search and try it out and feedback at some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question.
Projects
None yet
Development

No branches or pull requests

3 participants