Hi
we are using rancher as dev environment . developers can start stacks we created that contains cluster of 2 nodes and LB over some predefined machine pool of Ubuntu 16.04 docker 1.12.3.
we are currently doing poc of moving to rancher 1.2 but we noticed that the option to randomize external port in the LB was gone from docs . we tried to play with it but this use case that worked in rancher 1.1.3 is not working any more .
can you please advice ?
Thanks!
This should still work the same in compose and API; the balancer is essentially a regular service.
Hi
the definition bellow worked in previous version(without the version 2 syntax) but now i see that the request is not routed to the connected services on port 8080 .
i also see in that in haproxy.cfg
those lines are missing:
frontend 39836b06-dd79-4875-a428-d8f2f318b275_49960_frontend
bind *:49960
mode http
default_backend 39836b06-dd79-4875-a428-d8f2f318b275_49960_0_backend
backend 39836b06-dd79-4875-a428-d8f2f318b275_49960_0_backend
mode http
timeout check 2000
option httpchk GET /status HTTP/1.0
server 133ac75f-8e8a-4f5e-968c-372280ffc2fa 10.42.246.170:8080 check port 8080 rise 2 fall 3
server a972ccc8-01fd-4a8a-9c29-df21df5b5ec8 10.42.157.81:8080 check port
8080 rise 2 fall 3
http-request set-header X-Forwarded-Port %[dst_port]
Example :
Docker compose:
version: '2’
services:
lb:
image: rancher/lb-service-haproxy
stdin_open: true
tty: true
links:
- s2:s2
- s1:s1
ports:
- 57651:8080/tcp
labels:
io.rancher.container.agent.role: environmentAdmin
io.rancher.container.create_agent: 'true’
s1:
image: image1
ports:
- 62553:8080/tcp
- 59586:5701/tcp
s2:
image: image2
ports:
- 64023:8080/tcp
- 62320:5701/tcp
Rancher Compose:
version: '2’
services:
lb:
scale: 1
health_check:
port: 42
interval: 2000
unhealthy_threshold: 3
healthy_threshold: 2
response_timeout: 2000
s2:
scale: 1
health_check:
port: 8080
request_line: GET /status HTTP/1.0
unhealthy_threshold: 3
healthy_threshold: 2
response_timeout: 2000
s1:
scale: 1
health_check:
port: 8080
request_line: GET /status HTTP/1.0
unhealthy_threshold: 3
healthy_threshold: 2
response_timeout: 2000
the ports that i stated in the docker compose are indeed randomized by rancher as you stated but the routing from the load balancer to the services does not work. although i stated the links in the docker compose what am i missing ?
Thanks!
Thanks!