kubeasz/roles/lb/templates/keepalived-master.conf.j2

31 lines
575 B
Plaintext
Raw Normal View History

2017-11-11 19:14:21 +08:00
global_defs {
router_id lb-master
2017-11-11 19:14:21 +08:00
}
vrrp_script check-haproxy {
script "killall -0 haproxy"
interval 5
weight -30
}
vrrp_instance VI-kube-master {
state MASTER
priority 120
unicast_src_ip {{ inventory_hostname }}
unicast_peer {
{% for h in groups['lb'] %}{% if h != inventory_hostname %}
{{ h }}
{% endif %}{% endfor %}
}
2017-11-11 19:14:21 +08:00
dont_track_primary
interface {{ LB_IF }}
virtual_router_id {{ ROUTER_ID }}
2017-11-11 19:14:21 +08:00
advert_int 3
track_script {
check-haproxy
}
virtual_ipaddress {
2018-04-10 18:06:12 +08:00
{{ MASTER_IP }}
2017-11-11 19:14:21 +08:00
}
}