Re:HAproxy in the era of Microservices
by imdsm on Monday October 26, 2015 @11:11AM
(#10451947)
I think that HAProxy can work, but it needs assistance. As it doesn't allow you to use resolvable hostnames, you can't rely on DNS load balancing for microservices. As I said in my comment on the article, Consul + Consul-template works well for this.
[ Parent
| on HN ]
As of 1.6 it does allow resolvable hostnames [1]. This is the example given in the release announcement:
resolvers docker
nameserver dnsmasq 127.0.0.1:53
defaults
mode http
log global
option httplog
frontend f_myapp
bind :80
default_backend b_myapp
backend b_myapp
server s1 nginx1:80 check resolvers docker resolve-prefer ipv4
[1] http://blog.haproxy.com/2015/10/14/whats-new-in-haproxy-1-6/That's pretty new; but still doesn't remove the need for an orchestration layer (though it does make it a lot easier since I often rely on DNS with short TTLs for global routing).
Oh, cool, that's interesting!
Thanks for the heads up. Missed that one!
Yeah, you need an orchestration layer to really handle microservices at scale (yet another reason they're a pain in the ass!) Not just for HAproxy, but there are countless other situations where you need to use referential data to build configurations on the fly -- which is what an orchestration layer does.