KrisBee, can you explain how you managed to get this rancher-nfs to run?
First challenge for me is to remember the work flow order to get this going, it's four weeks since I did this and have not made much use of RancherUI since then. I got as far as creating data volumes using the rancher nfs driver for use with a couple of containers, and the driver can make use of pre-existing zpool datasets or can create sub-folders under existing datasets shared via NFS depending how you use the RancherUI to add storage volumes to the working rancher environment.
I started here
http://rancher.com/docs/rancher/v1.6/en/rancher-services/storage-service/rancher-nfs/.
IIRC the basic sequence was:
1. In FreeNAS set up NFS service with correct export params.
2. In FreeNAS setup required NFS shares taking care with dataset ownership.
3. Via RancherUI, launch Rancher NFS from the catalog (I used the default environment and global scope)
4. In RancherUI under Infrastructure > Storage add individual volumes required by the container(s) you wish to run.
5. Setup containers linking to the data volumes created in step.4 as necessary.
That's the outline as I remember it, but of course the devil's in the detail. The first thing is to appreciated that the Rancher docs say if you were using a linux NFS server the export must be with "no_root_squash" and so how is this to be interpreted for a NFS server running in FreeNAS? Also, the rancher-nfs driver defaults to a nfs4 client not nfs3. So how will an owner:group of "root:root" in Linux map to "root:wheel" in FreeNAS, etc. ?
To avoid id mapping problems between FreeNAS and Rancher I checked both the "Enable NFSv4" and "NFSv3 ownership model for NFSv4" for the NFS service in FreeNAS.
In the NFS first test share I created, I was going to let the rancher-nfs driver create sub-folders in the dataset. The dataset owner & group were set to root & wheel, I selected "all directories" under the NFS share to be mounted and set "Maproot User" to "root" and "Maproot Group" to "wheel".
In another case, where I wanted only to link a pre-exisitng zpool dataset to a docker container, the dataset was owned by normal non-root FreeNAS account. But the NFS share had the same settings as I previously used. So for example my NFS exports were:
Code:
root@freenasT:/ # cat /etc/exports
V4: / -sec=sys
/mnt/TestPool/media/music -alldirs -maproot="root":"wheel" -network 192.168.0.0/24
/mnt/TestPool/VM/docker -alldirs -maproot="root":"wheel" -network 192.168.0.0/24
root@freenasT:/ #
In this example, the "music" dataset pre-existed and was owned by a normal user, the "docker" dataset was owned by root and rancher was to create sub-folders in this share.
I'll have to see what notes, if any, I made about the actual settings I used when setting up the rancher-nfs driver and the individual data volumes. More to follow ....