Need some help with setting up NFS in RancherOS

DD4711

Contributor
Joined
Nov 19, 2018
Messages
102
Hello,

I am still trying to get rancheros running with a share service for my containers. I tried it with smb but I was told to check NFS.

What I already did:

my NFS Service Settings:
upload_2018-12-1_21-35-6.png


My NFS Share settings:
upload_2018-12-1_21-36-26.png


In FreeNAS I cerated a dataset named NFS, permissions are:
upload_2018-12-1_21-33-34.png


In RancherOS I installed under Catalog/Library "Rancher NFS" with this settings:
upload_2018-12-1_21-40-34.png


This is the page stacks:
upload_2018-12-1_21-41-51.png


this is page infrastructure/storage:
upload_2018-12-1_21-43-12.png


In RancherOS I found:
/var/lib/rancher/volumes/rancher-nfs/ec579a76-bc0d-439b-a466-cf87c7e978a7

Is this the mounted NFS Storage?

No I need to Add a volume in above page:
upload_2018-12-1_21-45-33.png

-> What do I ahve to enter here? I tried many things but it does not work.

If above is done, I should be able to create a container, where I configure a volume from NFS service, correct? What do I enter there?
upload_2018-12-1_21-47-54.png



Are my steps OK? Do I have to edit some of my work?


I'm despaired of setting up shares in rancherOS for containers like Plex, dokuwiki or similar. Hope someone can help me. :)
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
It looks right to me.

Now you just need to name your volume (call it what you want, it will become a sub-directory of /mnt/storage/NFS/ in your case).

Then you can use the proposed steps in the add volume screen in the container...

Volume will be:
<volumename>:/path/in/container/:ro (or rw if you want)

Volume driver will be:
rancher-nfs
 

DD4711

Contributor
Joined
Nov 19, 2018
Messages
102
Great, thank you sretalla!
I had a mistake in volume typo. Now it works!

Thanks :)
 

SavageAUS

Patron
Joined
Jul 9, 2016
Messages
418
Can the op re-up the images so i can see where i am going wrong please. Im trying to mount multiple datasets in rancher via nfs.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
It's clear that each driver only has an option for a single NFS share/path... and that the GUI only lets you install one driver.

It seems that the folks over at Rancher have worked on allowing a second (or maybe even many) drivers, but their documentation for that sucks (https://github.com/rancher/rancher-catalog/tree/v1.6-development/infra-templates/nfs/5 reference: https://github.com/rancher/rancher/issues/7618 ).

I can see the logic in wanting this to work, but at this point I don't have the time to figure it out (I did quickly copy the stack and was able to run a second one, but couldn't get anything to attach to it and the GUI didn't show it as an infrastructure stack, rather a user stack and the storage UI didn't seem to indicate any new option for volumes to be created in... maybe I didn't vary enough of the configs, but the path in docker-conpose.yml and the name in rancher-compose.yml seemed the only variables I should mess with... perhaps I needed to understand more about the volumes section and change something there... it's all guesswork at this point that I don't really have time or urgent need for).
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
It's clear that each driver only has an option for a single NFS share/path... and that the GUI only lets you install one driver.
I don't think that's actually right... it seems there's some other way to provide driver_opts to add more NFS paths... it still isn't very clear from the documentation how to actually do that, but I might be feeling brave enough to try it later in the week.

I did quickly copy the stack and was able to run a second one, but couldn't get anything to attach to it and the GUI didn't show it as an infrastructure stack, rather a user stack and the storage UI didn't seem to indicate any new option for volumes to be created in... maybe I didn't vary enough of the configs, but the path in docker-conpose.yml and the name in rancher-compose.yml seemed the only variables I should mess with... perhaps I needed to understand more about the volumes section and change something there... it's all guesswork at this point that I don't really have time or urgent need for
Do NOT try that at home kids... it completely messed up my existing rancher-nfs data and killed all my running containers with storage on it.

I'm well aware that arguing with myself in a forum looks odd, but I couldn't leave that statement without a warning.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
OK, so I managed to work it out:

You set up the driver with one pair of an NFS host and an exportBase when you start.

Then, when creating the volume in the GUI, use the additional driver opts (by clicking Add Pair a couple of times) then filling in your host and base path... I'm not 100% clear on the need to specify the retain/discard per volume or host or if it follows your selected option when creating the driver, but you may want to do that too.

1551996327677.png


Make sure that your NFS settings on FreeNAS (the service, not the share itself) is set for NFSv4 (mine had inherited to be off from before the upgrades to the latest version and Rancher didn't like it not matching, so wouldn't run the driver.

Then, of course, you just use the named volume as any other Rancher-nfs volume in a service/container, even alongside ones from other NFS sources.
 
Top