Continuing the discussion from
Load Balancer config:
So pointing a load balancer at a hostname is fairly unusual. It’s weird because it’s not clear when to resolve the name into a list of IPs… Every request would be terribly slow, observing the TTL of the DNS record is adding DNS code to the load balancer. So ha-proxy’s (and I believe nginx and most hardware balancers) behavior is to resolve the name on startup and never read it again (until restart).
That behavior is rather undesirable if
external.com ever changes. In particular, Amazon ELB regularly changes the target IPs of their balancers, so the name you get for many common SaaS services would regularly break.
So the UI specifically hides external services that point to a hostname (vs IP addresses) from the dropdown because it’s not supported yet. Your step 2 is basically tricking the UI into allowing that because I don’t recursively follow alias chains when filtering them out
It appears the backend API doesn’t actually support this either (
@alena) so it’s configuring based on an empty list of target IPs, and according to your output not even creating a
backend entry at all.
To say we support hostnames I think we’d have to make it work the way users expect, updating periodically according to the hostname’s TTL. I think we’ll need to add-on something that watches the names that are in the config, polls them periodically, and reloads ha-proxy whenever the list of IPs changes.
So, given the above, I would expect a service alias to work when used in a LB, but that doesn’t seem to work either.
But it doesn’t seem to work…
I have a made up example to show what I’ve reduced it to. Lookging at the HAproxy config, I would expect there to be two frontend sections, one for
alias and one for
app, but I only get one for
app. So, the alias one doesn’t seem to work…
acl 0_host hdr(host) -i app:9999
use_backend 74d355d8-72cd-43c8-b7f6-7703aef3f2a4_0_backend if 0_host
With this stack:
docs suggest that this should work.