• 17 Posts
  • 40 Comments
Joined 1 year ago
cake
Cake day: June 9th, 2023

help-circle














  • rglullis@communick.newstoDockerShared Volumes Question
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    5 months ago

    I don’t know if you had any issue with the formatting, but your first example is not going to work because you are putting the volumes mapping at the top-level. The correct would be:

    version: "3.8"
    
    services: 
      example1:
        image: example.com/example1:latest
        ports: "8000:80"
        volumes: 
          - shared_example:/data
    
      example2:
        image: example.com/example2:latest
        ports: "8080:80"
        volumes: 
          - shared_example:/data
    
    volumes:
      shared_example: 
        driver_opts: 
          type: nfs
          o: "192.100.1.100, nolock,soft,rw"
          device: ":/local/shared"
    









  • I’m aware of it and it’s quite likely what I am going to be using. Have you any experience with it?

    My main challenge at the moment is that I didn’t find a good architecture to scale stateful services horizontally on Docker Swarm. I’ve been happy with everything else, except this. I can scale my object storage by just adding new nodes to minio storage pools, I can provision new services fine and ansible + portainer has been enough for me on my CD pipeline.

    The one thing that is still a bit fragile on my setup is that any volumes for services like a database or elasticsearch end up tied to the server, and there is no good solution to make HA for them. I tried glusterFS but quickly learned that it can corrupt a database if your service gets rescheduled to a different server and it restarts before the replication is complete.

    I think that what I am looking for is something like a Ceph cluster and just use that a proper driver for it, but unfortunately I didn’t find any docker plugin that is well-maintained for that. This is the only reason that I’m looking into kubernetes at all.