Question about external IP on a load balancer for a stack. What is the best practice?

We’re trying to deploy a simple application on Rancher as a test case for the platform, and a first dive into containerizing our infrastructure. As a test setup, we have a single box, running RancherOS and Rancher running on that host.

The stack we are trying to deploy consists of a API, DB and Job server. Relatively simple. We manually setup the stack components, it wasn’t clear how to use environment files with docker compose file (perhaps a catalog?), so this seemed to be the easiest way.

When we deployed these containers, we put a load balancer in front of the container and tried to bind to a public IP to the load balancer, and HA Proxy failed to start - it couldn’t bind the IP to the container.

So my question is, are we doing this the correct way? Am I missing something obvious, or is the answer to create a container to function as a termination point for the public IP and the route the stack.

Thanks!

What version of Rancher? In 1.1 lower docker is given the ip/port bindings and the requested IP is actually given to bind, which means that IP must be actually bound to a physical interface (i.e. it appears in ifconfig or similar on the host). That is not typically the case with cloud provider VMs, additional IPs are typically routed to the host but not really on an interface.

In 1.2+ the pretty mapping is done with iptables so if a connection comes in and says it’s for an IP and you have a destination for it it’ll work. And 1.4 will have actual allocation for ports on hosts with multiple IPs.