-
Notifications
You must be signed in to change notification settings - Fork 1
/
haproxy-cfg-template.j2
32 lines (29 loc) · 1.03 KB
/
haproxy-cfg-template.j2
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
#---------------------------------------------------------------------
# haproxy frontend for stats
#---------------------------------------------------------------------
frontend stats
bind *:8404
stats enable
stats uri /stats
stats refresh 10s
stats admin if LOCALHOST
#---------------------------------------------------------------------
# apiserver frontend which proxys to the control plane nodes
#---------------------------------------------------------------------
frontend apiserver
bind *:6443
mode tcp
option tcplog
default_backend apiserver
#---------------------------------------------------------------------
# round robin balancing for apiserver
#---------------------------------------------------------------------
backend apiserver
option httpchk GET /healthz
http-check expect status 200
mode tcp
option ssl-hello-chk
balance roundrobin
{% for host in groups['control'] %}
server {{ host }} {{ hostvars[host]['ansible_host'] }}:6443 check fall 3 rise 2
{% endfor %}