2019-02-07 15:10:49 +08:00
|
|
|
global_defs {
|
|
|
|
router_id lb-master-{{ inventory_hostname }}
|
2019-07-17 22:48:57 +08:00
|
|
|
script_user root
|
|
|
|
enable_script_security
|
2019-02-07 15:10:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
vrrp_script check-haproxy {
|
2019-07-17 22:48:57 +08:00
|
|
|
script "/usr/bin/killall -0 haproxy"
|
2019-02-07 15:10:49 +08:00
|
|
|
interval 5
|
|
|
|
weight -60
|
|
|
|
}
|
|
|
|
|
|
|
|
vrrp_instance VI-kube-master {
|
|
|
|
state MASTER
|
|
|
|
priority 120
|
|
|
|
unicast_src_ip {{ inventory_hostname }}
|
|
|
|
unicast_peer {
|
|
|
|
{% for h in groups['ex-lb'] %}{% if h != inventory_hostname %}
|
|
|
|
{{ h }}
|
|
|
|
{% endif %}{% endfor %}
|
|
|
|
}
|
|
|
|
dont_track_primary
|
|
|
|
interface {{ LB_IF }}
|
|
|
|
virtual_router_id {{ ROUTER_ID }}
|
|
|
|
advert_int 3
|
|
|
|
track_script {
|
|
|
|
check-haproxy
|
|
|
|
}
|
|
|
|
virtual_ipaddress {
|
2019-05-30 21:37:01 +08:00
|
|
|
{{ EX_APISERVER_VIP }}
|
2019-02-07 15:10:49 +08:00
|
|
|
}
|
|
|
|
}
|