HAProxy community

Load balancing a dynamic cluster of IP addresses

Hi! I hope you’re all doing well :slight_smile:

I’ve got a HAProxy setup which runs on the edge of our cluster brilliantly. I’ve built in failover using PCS and it’s been absolutely solid.

Within our cluster we’ve traditionally had X number of nodes, each referenced in the configuration as below. The proxy also performs TLS termination (hence the HTTP mode rather than TCP’ing it through).

backend web

    mode http
    balance leastconn
    option tcp-check
    # default-server check-send-proxy send-proxy check port 2443 fall 3 rise 2
    default-server port 80 check port 443 fall 3 rise 2 send-proxy
    reqadd X-Forwarded-Proto:\ https
    reqadd X-Forwarded-Port:\ 443

    server web01 192.168.1.20:80
    server web02 192.168.1.21:80
    server web03 192.168.1.22:80

In the above instance, I know that we have three nodes on their respective IP’s, .20, .21 & 22. However, we are now looking at a new solution which can spawn nodes at any point and can be on any address being .20 - .50. Is there an easy/suggested way to handle this use case?

I’m imagining I’ll still have to configure each node like the above configuration, but we’d expect a majority of them to be appear offline. Is there a way to not show down status but mark the out nodes as backups, and then when they come online automatically make them an active node?

What I ideally don’t want is a sea of red on the status page as most of the IP’s are unallocated and unresponsive.

Thanks!

You can configure servers in disabled state.