Alternative to IP based services?
Closed this issue · 13 comments
Has it been considered to also support service registry by providing a service host rather than only an IP?
I was interested in using hydra
to register services deployed via http://zeit.co/now
Unfortunately they are not accessible via IP address, as the hostname is used for routing.
I considered just putting the hostname in the description
property but it is pretty hacky. Any better suggestions that I'm just not seeing in the docs?
@derrickpelletier this isn't something we've considered. How would ports work? And multiple instances of a service?
@cjus hah, bad luck. It's up now.
I hadn't considered it much further. I guess I would expect multiple instances to work as unique hostnames? I know at least for now
, clustering/scaling is handled on their end.
To what end would ports be necessary? I guess I envisioned using hydra.findService
and using the returned service-info to make my requests. Are there other hydra apis that wouldn't be able to handle this?
@derrickpelletier if you're available next week I'd like to discuss over skype. @cjustini34
I'm very interested too ;)
Me too.
I made a quick test last week removing "host to IP" functionality from Hydra and using it with domains, and everything was looking good!! I didn't see any problem.
@cjus Is there any reason why Hydra needs only IP?
Thanks
@limay this idea is really growing on me! @derrickpelletier thanks for raising this opportunity!
@limay I don't think so. There's no reason hydra should care whether an IP is used or a DNS entry! Hydra-router shouldn't either - but that's something to test as well.
@derrickpelletier @limay @parweb you can try an experimental release:
- $ npm install hydra@1.3.9-experimental
- $ npm install hydra-express@1.4.4-experimental
Just specify a DNS name in your service config:
"serviceIP": "cjmac",
@derrickpelletier @limay @parweb hydra-express now supports DNS usage via the new serviceDNS
entry. Simply place the DNS name of your service in that field and it will work with external load balancers. I've tested this inside of a docker swarm using the swarm DNS. Can one of you test this in your usecase so I can close this ticket? ;-)
@cjus Sorry for the delay! I'm eager to try your solution but I find a second until now. Let me test it and I reply here ASAP. Thanks!
@parweb Sorry! Basically, I bypassed a code that checked if serviceIP is a valid IP and put the url (and it worked fine!) But it doesn't matter anymore because serviceDNS seems a good solution.
@cjus will try it out this weekend, thanks!
@derrickpelletier @limay @parweb I'd like to close this ticket if possible.