As part of my mini-blog about migrating to Kubernetes I am currently setting up an NFS share to allow kubernetes hosts hosting pods on shared storage, so the pods can be deployed anywhere on a host with the right labels.
Since I am using Hetzner as cloud provider and they are not offering anything with NFS, I had to mount via SSHFS, which is an fuse file system. That means it runs in user space, not kernel space. In order to share that with NFS you have to use NFS4, which means your kernel has to support it. To find out if you are using NFS4, use the following command: $ rpcinfo -p | grep nfs
This will output something like 100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100227 3 tcp 2049 nfs_acl
If you see "100003 4 tcp 2049 nfs
", you are good to go.
But you also need to set an fsid= flag in your exports file. fsid needs to be unique, and starts with fsid=root (same as fsid=0). In my case only fsid=root worked, and all subsequential exports have to have an increment, i.e. fsid=1 etc. So your export line should probably look like /var/share 10.0.1.0/24(rw,sync,no_subtree_check,fsid=root)
Then run exportfs -a to check if the export works.
Happy coding!
Home » How to share fuse file systems with NFS