haproxy.cfg 810 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
global
	log /dev/log	local0
	log /dev/log	local1 notice
	chroot /var/lib/haproxy
	stats socket /run/haproxy/admin.sock mode 660 level admin
	stats timeout 30s
	user haproxy
	group haproxy
	daemon

defaults
	log	global
	mode	tcp
	option tcplog
    	timeout client  1m
	timeout server 1m
	timeout connect 10s

frontend http-frontend
    bind *:80
    default_backend http-backend

backend http-backend
   balance roundrobin
   #  32353 is the "NodePort" of Ingress HTTP Service
   server worker1 1.1.1.120:32353 check
   server worker2 1.1.1.121:32353 check

frontend https-frontend
    bind *:443
    default_backend https-backend

backend https-backend
   balance roundrobin
   # 30249 is the "NodePort" of Ingress HTTPS Service
   server workers1 1.1.1.120:30249 check
   server workers2 1.1.1.121:30249 check