Does DigitalOcean have a plan to offer shared storage volumes for Docker Swarm Mode in near future?

October 16, 2017 1.2k views
Docker

We have been using DO for all development/testing activities. We have successfully deployed a scalable staging environment using Docker Swarm Mode. The only glitch is that we can not scale the application container across multiple swarm nodes as these instances can not share a persistence storage (volumes) across the nodes. There are many suggestions from unofficial sources to use NFS, Flocker, GlusterFS, etc. But there is no clear direction / guideline from DigitalOcean.

Without an officially supported solution for shared storage from DO, we have to regretfully leave DO and join the AWS band wagon.

2 Answers

DigitalOcean does not have an official storage plugin for Docker Swarm. In general, I'd recommend using REX-Ray. It can be used with Docker Swarm as well as other schedulers like Kubernetes and Mesos. The initial implementation of the DigitalOcean plugin was done by a DO engineer.

You can handle the initial configuration by running:

  • docker plugin install rexray/dobs DOBS_REGION=sfo2 DOBS_TOKEN=YOUR_API_TOKEN

Now running docker volume ls will expose any DigitalOcean block storage volumes you may have already created. You can create new ones via:

  • docker volume create -d rexray/dobs --name do-volume-sfo2 --opt=size=100

Now you can treat that like any other Docker volume. The plugin will handle mounting it locally as needed.

rexray/dobs is a good option, but it seems that you can only have the volume attached to one node at each time (I suppose that is a digitalocean limitation), so this is not useful if you want to have the volume mounted into several nodes at the same time.

Have another answer? Share your knowledge.