ContainX / docker-volume-netshare

Docker NFS, AWS EFS, Ceph & Samba/CIFS Volume Plugin
http://netshare.containx.io
Apache License 2.0
1.11k stars 164 forks source link

How can i use this with swarms? #197

Open Mrs-Feathers opened 2 years ago

Mrs-Feathers commented 2 years ago

after creating a container using this driver as the volume driver in the swarm, if it migrates to another host, it cannot read anymore from the volume. how can i make it sync across the swarm? how can i make this driver the default volume driver?

kpolucas commented 2 years ago

IDK if this is the way, im only sharing my experience in swarm.
Install the plugin on every node.
change the yml of the deploy for something like this

volumes:
  nginx.vol:
    driver: nfs
    driver_opts:
      share: 1.1.1.1:/path_nfs_server

And profit!

Also idk if this is a bug but when i try to mount an empty directory got failed to chown /var/lib/docker/volumes/MYVOLUME/_data: lchown /var/lib/docker/volumes/MYVOLUME/_data: operation not permitted
Even when the nfs-server permissions are fine

My workaround, just mount a directory with some files.