Sample HAProxy Config - CloudCommandos/JohnChan GitHub Wiki

frontend k8s-haproxy
    bind 0.0.0.0:60443
    mode tcp
    option tcplog
    default_backend k8s-haproxy
backend k8s-haproxy
    mode tcp
    option tcplog
    option http-keep-alive
    option http-server-close
    balance roundrobin
    default-server inter 10s downinter 5s rise 2 fall 2 slowstart 60s maxconn 250 maxqueue 256 weight 100
        server kube0 10.0.1.100:6443 check fall 3 rise 2
        server kube1 10.0.1.101:6443 check fall 3 rise 2
        server kube2 10.0.1.102:6443 check fall 3 rise 2

frontend k8s-ingress
    bind 0.0.0.0:58080
    mode http
    option tcplog
    redirect scheme https code 301 if !{ ssl_fc }
    default_backend k8s-ingress
backend k8s-ingress
    mode http
    option tcplog
    option tcp-check
    option http-keep-alive
    balance roundrobin
    default-server inter 10s downinter 5s rise 2 fall 2 slowstart 60s maxconn 250 maxqueue 256 weight 100
        server kube3 10.0.1.103:80 check fall 3 rise 2 send-proxy
        server kube4 10.0.1.104:80 check fall 3 rise 2 send-proxy
        server kube5 10.0.1.105:80 check fall 3 rise 2 send-proxy
        server kube6 10.0.1.106:80 check fall 3 rise 2 send-proxy
        server kube7 10.0.1.107:80 check fall 3 rise 2 send-proxy

frontend k8s-tls-ingress
    bind 0.0.0.0:50443
    mode tcp
    option tcplog
    default_backend k8s-tls-ingress
backend k8s-tls-ingress
    mode tcp
    option tcplog
    option ssl-hello-chk
    option http-keep-alive
    balance roundrobin
    default-server inter 10s downinter 5s rise 2 fall 2 slowstart 60s maxconn 250 maxqueue 256 weight 100
        server kube3 10.0.1.103:443 check fall 3 rise 2 send-proxy
        server kube4 10.0.1.104:443 check fall 3 rise 2 send-proxy
        server kube5 10.0.1.105:443 check fall 3 rise 2 send-proxy
        server kube6 10.0.1.106:443 check fall 3 rise 2 send-proxy
        server kube7 10.0.1.107:443 check fall 3 rise 2 send-proxy

frontend k8s-mqtt-ingress
    bind 0.0.0.0:51883
    mode tcp
    option tcplog
    default_backend k8s-mqtt-ingress
backend k8s-mqtt-ingress
    mode tcp
    option tcplog
    option tcp-check
    balance roundrobin
    default-server inter 10s downinter 5s rise 2 fall 2 slowstart 60s maxconn 250 maxqueue 256 weight 100
        server kube3 10.0.1.103:1883 check fall 3 rise 2
        server kube4 10.0.1.104:1883 check fall 3 rise 2
        server kube5 10.0.1.105:1883 check fall 3 rise 2
        server kube6 10.0.1.106:1883 check fall 3 rise 2
        server kube7 10.0.1.107:1883 check fall 3 rise 2