2017-11-11 19:14:21 +08:00
|
|
|
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
|
|
|
|
nbproc 1
|
|
|
|
|
|
|
|
defaults
|
|
|
|
log global
|
|
|
|
timeout connect 5000
|
2018-02-07 10:25:21 +08:00
|
|
|
timeout client 10m
|
|
|
|
timeout server 10m
|
2017-11-11 19:14:21 +08:00
|
|
|
|
|
|
|
listen kube-master
|
2018-04-17 21:14:03 +08:00
|
|
|
bind 0.0.0.0:{{ KUBE_APISERVER.split(':')[2] }}
|
2017-11-11 19:14:21 +08:00
|
|
|
mode tcp
|
|
|
|
option tcplog
|
2018-07-13 14:36:55 +08:00
|
|
|
balance {{ BALANCE_ALG }}
|
2018-06-10 08:32:34 +08:00
|
|
|
{% for host in groups['kube-master'] %}
|
|
|
|
server {{ host }} {{ host }}:6443 check inter 2000 fall 2 rise 2 weight 1
|
|
|
|
{% endfor %}
|
|
|
|
{% for host in groups['new-master'] %}
|
|
|
|
server {{ host }} {{ host }}:6443 check inter 2000 fall 2 rise 2 weight 1
|
|
|
|
{% endfor %}
|
2018-09-04 00:05:38 +08:00
|
|
|
{% if INGRESS_NODEPORT_LB == "yes" %}
|
|
|
|
|
|
|
|
listen ingress-node
|
|
|
|
bind 0.0.0.0:80
|
|
|
|
mode tcp
|
|
|
|
option tcplog
|
|
|
|
balance {{ BALANCE_ALG }}
|
|
|
|
{% for host in groups['kube-node'] %}
|
|
|
|
server {{ host }} {{ host }}:23456 check inter 2000 fall 2 rise 2 weight 1
|
|
|
|
{% endfor %}
|
|
|
|
{% for host in groups['new-node'] %}
|
|
|
|
server {{ host }} {{ host }}:23456 check inter 2000 fall 2 rise 2 weight 1
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|