I have been trying to use Rancher-NFS service to create volumes for my services. I am little bit confused about how to create volumes or to configure services about volumes names. When trying to mount the NFS resource it is using the volume-name as a directory to compose the origin mount.
For example:
version: '2'
volumes:
AEON-Config:
driver_opts:
exportBase: /config/
host: HOST-IP
driver: rancher-nfs
services:
AEON-API:
image: IMAGE
stdin_open: true
volumes:
- AEON-Config:/config/infrastructure.js
- AEON-Config:/config/secrets.js:ro
tty: true
ports:
- 3000:3000/tcp
command:
- start
labels:
io.rancher.container.pull_image: always
Because I am using AEON-Config as the volume name, when mounting the NFS resource it tries to do the following:
"Failed to mount AEON-Platform_AEON-Config_87357: Failed nsenter -t 726 -n mount NFS-SERVER:/config//AEON-Platform_AEON-Config_87357 /var/lib/rancher/volumes/rancher-nfs/AEON-Platform_AEON-Config_87357"
of course, NFS-SERVER:/config//AEON-Platform_AEON-Config_87357 does not exists, what exists is NFS-SERVER:/config/
So, if I use the directory to export as volume name it works, but it seems a little bit extrange to use volume names for an exporting directory.