global log 127.0.0.1 local2 chroot /var/lib/haproxy pidfile /var/run/haproxy.pid maxconn 4000 user haproxy group haproxy # turn on stats unix socket stats socket /var/lib/haproxy/stats #--------------------------------------------------------------------- # common defaults that all the 'listen' and 'backend' sections will # use if not designated in their block #--------------------------------------------------------------------- defaults mode http log global option dontlognull option redispatch retries 3 timeout http-request 10s timeout queue 1m timeout connect 10s timeout client 1m timeout server 1m timeout http-keep-alive 10s timeout check 10s maxconn 3000 listen ingress-http bind 0.0.0.0:80 mode tcp %{for name, ip in master_nodes~} server ${name} ${ip}:80 check %{endfor~} %{for name, ip in worker_nodes~} server ${name} ${ip}:80 check %{endfor~} listen ingress-https bind 0.0.0.0:443 mode tcp %{for name, ip in master_nodes~} server ${name} ${ip}:443 check %{endfor~} %{for name, ip in worker_nodes~} server ${name} ${ip}:443 check %{endfor~} listen api bind 0.0.0.0:6443 mode tcp %{for name, ip in master_nodes~} server ${name} ${ip}:6443 check %{endfor~}