Rancher HA - Load Balancing port 80 and 443

Hello,

I have created a new High Availability environment, as the image below:

Each one of the hosts has a public IP assigned to the eth0.

The port 80 and 443 to are published for the rancher system loadbalancer which serves as backend for the “External Load Balancer”, and this for on all the hosts.

Now, I would like to create a Load Balancer under user stacks which acts as LB for all the services that I will create below (ie, webserver).

The problem is that when I create a new Load Balancer for the Apps and set the binding port in 80:80, I get this error:
“Error (Scheduling failed: host needs ports 80/tcp available)”

So I would like to ask you:
How should I configure a Load Balancer to get work all the webserver apps?

Thank you!

1 Like

Hey yefryf, I had the same issue, looks like there are 2 solutions to this issue:

  1. Change Rancher HA LB ports: in your rancher-ha.sh script change these CATTLE_HA_PORT_HTTP, CATTLE_HA_PORT_HTTPS to other ports (make sure you adjust your firewalls for these too).
  2. Add an extra host (this one is not part of HA setup) and schedule your container there. This way your additional host won’t have a port conflict.

Let me know if you have a better solution. I’d also like to hear what the guys from Rancher have to say.

Update

A better way is to go to the “management” stack and edit “load-balancer” service and add an entry under “Targets”. You can reuse the 80 or 443 port with a custom “Request Host” or “Request Path”