Docker Community Forums

Share and learn in the Docker community.

Multiple service names for Swarm Mode Service in overlay network

We’re looking at moving some of our services into a swarm mode cluster. So far, it’s going well, but we’ve hit a snag.

Our services can sometimes be accessed by multiple names. whether this is a prefix (usually a legacy concern) or because two very related services are bundled together but keep their different names (for consistency).

Is there any way to have the overlay network service discovery work with two names for the same service?

The services are stateless so, it’s technically possible to just run 2 or 3 instances of the same service, but this seems messy.

We’d like to have as few moving parts as possible, so, we’d like to avoid adding something else for service discovery.

Did you find a way to “alias” services in swarm mode? I’ve run into the excact same issue, and it appears that we’re running into a major headache in terms of rewriting configuration files if we can’t do this…

We didn’t find a way to do this, we’re just running copies of the service, it’s a few extra GB of memory usage, but couldn’t figure out a way around it. We’re also considering moving to something like Kontena to avoid this problem.

Sorry to hear. Will Kontena be able to provide DNS zones for a single overlay network?

Have a look through their documentation, I think so, but I’m no expert.

I’ve created a Docker Issue to check if this feature is something which could be considered for Docker, or if it is something that is doable with Docker as it works today.