costela/docker-volume-hetzner

Use with replicas

stewartmcgown opened this issue · 3 comments

Is it safe to use this with a Swarm / Compose service that has multiple replicas? Expected behaviour would be to create a volume named for the replica number of the container.

Unfortunately not without a big caveat: only if your replicas are all on the same node. Since AFAIK this cannot be enforced if you have more than one node, this means it's basically not supported.
See the limitations in the README.

I haven't used Swarm in years though, so maybe in the meantime there are ways around this limitation?

I see you've also moved on to k8s, perhaps I've backed the wrong horse by setting myself up on Swarm :/

Yes, swarm seemed like a less complex version of k8s, but in the meantime development seems to have stalled and its limitations are IMHO showing.
Plus, there are now a lot of options for keeping self-hosted k8s' complexities to a minimum (e.g. k3s).