yyyar / gobetween

:cloud: Modern & minimalistic load balancer for the Сloud era
http://gobetween.io
Other
1.94k stars 210 forks source link

Need to add functionality for discovering and balance containers without host-exposed network. #47

Open nickdoikov opened 7 years ago

nickdoikov commented 7 years ago

according to a #46 need to add such functionality.

We need to add mechanism for discovery linked containers this is a common use case for developers , regular users etc.. I will add more info here later

illarion commented 7 years ago

Also, it seems that we can't rely on HOSTNAME env var set by compose during docker-compose up, since it's not exposed via docker inspect api.

nickdoikov commented 7 years ago

in this case we use Gobetween container as a part of linked containers infrastructure. Hostnames should be available from inside containers. https://docs.docker.com/compose/compose-file/#links

WoLfulus commented 7 years ago

how's this going? I'm trying gobetween but as this is missing it broke my legs :(

nickdoikov commented 7 years ago

@WoLfulus please describe your case.

WoLfulus commented 7 years ago

I couldn't make docker work at all. The IP addresses on /stats API always seems to be empty and port 0. Seems like it's not getting the proper host info at all to correctly make the connection.

In resume, I have a compose file which defines several services and networks, one of the services is gobetween with docker.sock mounted.

gobetween couldn't detect the ip and ports on the services (I had to expose the port, but IP is still empty).

Also, there's no way to define weight and stuff in docker: my suggestion is to define several labels (like gobetween.service.weight and maybe override its them in configs)

Note: I'm not in swarm mode.

BTW: I forked gobetween to try "fixing" it, and I made it get the proper IP address/port, but I couldn't continue working on it anymore. But I don't think it's the best way to retrieve it because there could be more networks in a container.