HaProxy back-end as subnet

Hello,

Can I somehow add whole subnet to back-end?
Example:
server app 192.168.82.0/24:3000 check

If i try to do this, i get syntax error when I restart haproxy service.
I need this in case, cloud starts to scale-out or scale-in. Or do I need to reconfigure haproxy.cfg manually and restart service?

According to the documentation (https://cbonte.github.io/haproxy-dconv/1.7/configuration.html#server), the server statement accepts only one IP address. If you want to add multiple backend servers, you need to add them one by one:

server app-001 192.168.82.1:3000 check
server app-002 192.168.82.2:3000 check
server app-003 192.168.82.3:3000 check

… and so on …

It may not have multiple IP at Instance, only one by on, otherwise parser error would come from configuration file

1 Like