LB targeting alias service

Continuing the discussion from Load Balancer config:

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:

testApp:
  restart: always
  tty: true
  image: nginx
  stdin_open: true
testAlias:
  labels:
    io.rancher.service.hash: 0df56b30668fd75508e1014b02924696ea6c0127
  image: rancher/dns-service
  links:
  - testApp:testApp
testLB:
  restart: always
  ports:
  - '9999'
  labels:
    io.rancher.service.hash: 04e47c9e88b6cb76e7402147d5622bda0381dd4e
    io.rancher.loadbalancer.target.testApp: app=8080
    io.rancher.loadbalancer.target.testAlias: alias=8080
  tty: true
  image: rancher/load-balancer-service
  links:
  - testAlias:testAlias
  - testApp:testApp
  stdin_open: true
testApp:
  scale: 1
testAlias:
  metadata:
    io.rancher.service.hash: e84640c8cc8707f9f7c411aa2a576a387abbf560
testLB:
  scale: 1
  metadata:
    io.rancher.service.hash: 27ed8e7c2afa77b797508795b80ace6b19de3c67

Reading the docs suggest that this should work.

This sounds like https://github.com/rancher/rancher/issues/2047 ; I think @alena is getting ready to do a round of balancer fixes.

Thanks @vincent, that does indeed look like what I was experiencing. Plus 1’d. :wink: