Multiple rancher-nfs instances in a single environment?

Hello,

I’m using rancher-nfs in an environment (it works). Now I’d like to start a second instance of rancher-nfs to access a second NFS storage for certain service.

Is this supposed to be possible at all?

What I’ve tried so far is to export the stack, change the name of the storage driver and start the stack as “nfs2” using rancher-cli:

services:
  nfs-driver:
    privileged: true
    image: rancher/storage-nfs:v0.6.5
    environment:
      MOUNT_DIR: /nfs2
      MOUNT_OPTS: ',nfsvers=4'
      NFS_SERVER: 192.168.1.200
    volumes:
    - /run:/run
    - /var/run:/var/run
    - /dev:/host/dev
    - /var/lib/rancher/volumes:/var/lib/rancher/volumes:shared
    logging:
      driver: json-file
      options:
        max-file: '2'
        max-size: 25m
    pid: host
    labels:
      io.rancher.container.agent.role: environment
      io.rancher.container.create_agent: 'true'
      io.rancher.scheduler.global: 'true'
services:
  nfs-driver:
    storage_driver:
      name: rancher-nfs-2
      scope: environment
      volumeAccessMode: multiHostRW
    start_on_create: true

The stack starts, but trying to use it fails:

Removing bad service instance: Error response from daemon: create iljatest: create iljatest: Error looking up volume plugin rancher-nfs-2: legacy plugin: plugin not found

And indeed, as far as I can see, a storage driver with my expected name “rancher-nfs-2” is never started on the rancher agents.

Should this work at all? Or is there another way to start the driver?

@iljaweis this is being worked on at the moment. I’ll look to see when its planned. Here’s some information to get you to test it before it goes live: https://github.com/LLParse/rancher-catalog/blob/5f06d2df713ab94ccf38d78be90d4b52e4005eec/infra-templates/nfs/3/README.md

You’ll need to use the following image with that custom template:
llparse/storage-nfs:dev

Also tracking the feature here: https://github.com/rancher/rancher/issues/7618

Thanks, that works as expected! (now available for 1.6.0)

If this works, is there a reason that you can’t spin up more than one of the Rancher NFS templates from the catalog? Is it because it is an infrastructure stack?