Mohsen Samiei
Mohsen Samiei

Reputation: 151

Using custom service discovery with docker swarm

I have a docker swarm mode orchestration on my servers, and as my business requirements I have a custom service discovery (it's run by swarm too).

Every services after running call register method on service discovery and introduce his contact information.

So service discovery could reversing traffics and balancing load between instance by introduced ip and port

My problem there is, when an instance(ruined in container) call discovery register method, his remote-addr is not real (mean it's not equal to hostname -i) and service discovery can not find it in network

Is any idea?

Upvotes: 0

Views: 135

Answers (1)

sfb103
sfb103

Reputation: 384

One option would be for the service discovery to also participate in the swarm. Then it should be able to find the instances which are in containers that are in the swarm.

Another would be for the containers to run with --net=host. Though this may defeat the reason for having them in a swarm in the first place.

Upvotes: 1

Related Questions