Adding and NFS share to rancher docker host

Sivivatu

Dabbler
Joined
Jan 7, 2019
Messages
19
I'm trying to set-up a docker environment with a shared nfs store from my freenas server. I'm trying to follow the instructions in the docs but am failing to get the nfs host seen in the Rancher Server. The part im most confused about is the final line in the FreeNAS docs to
Add :nocopy to the end of the pool to be mounted: mount -t nfs pool:[I]/mnt/pool1[/I]:nocopy [I]~nfsmounts/pool1_mount[/I]
but where is that supposed to be added? is that in the freenas or the rancher image? but in the rancher image you don't (afaik) run the mount process like that, it is included in the docker compose but where does it get added in the docker compose/volume options?

I have installed the rancher nfs driver (image: rancher/storage-nfs:v0.9.1) but it never seems to successfully start.

In FreeNAS I have setup the nfs server as below:
1551264919088.png

I'm completely lost as to how to get the nfs host working so it can be used for persistent storage and any help would be greatly appreciated.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Once you have the nfs share on FreeNAS, you should do the rest from the Rancher Server GUI. (I recall having needed to set my NFS share to be NFSv4 but allowing v3 permissions on Freenas before it worked).

You should probably have 3 Rancher VMs, 1 for the server (that runs your Rancher GUI) and 2 for "cattle" (the ones that will run your containers).

If you run this way, you will always be able to evacuate one of the cattle, kill it and replace with another upgraded one without really requiring downtime as long as your NFS setup is good.

From the Rancher GUI, go to Catalog and find the Rancher-nfs driver and install it.

Then under Infrastructure - Storage, set up a volume for every docker -v you want (directories only, no file-level presentation with the rancher-nfs driver).

You can probably do a lot of reading on the RancherOS website to work it all out if you need more information.

I can answer specific questions here, but I'm not in the business of writing a how-to guide (which already exists).
 
Top