diff --git a/roles/lb/templates/keepalived-backup.conf.j2 b/roles/lb/templates/keepalived-backup.conf.j2 index 06f32cb..38cdaa2 100644 --- a/roles/lb/templates/keepalived-backup.conf.j2 +++ b/roles/lb/templates/keepalived-backup.conf.j2 @@ -5,6 +5,11 @@ global_defs { vrrp_instance VI-kube-master { state BACKUP priority 110 + unicast_src_ip {{ inventory_hostname }} + unicast_peer { + {% for h in groups['lb'] %}{% if h != inventory_hostname %}{{ h }}{% endif %}{% endfor %} + + } dont_track_primary interface {{ LB_IF }} virtual_router_id {{ ROUTER_ID }} diff --git a/roles/lb/templates/keepalived-master.conf.j2 b/roles/lb/templates/keepalived-master.conf.j2 index d9d6ed2..367bb3c 100644 --- a/roles/lb/templates/keepalived-master.conf.j2 +++ b/roles/lb/templates/keepalived-master.conf.j2 @@ -11,6 +11,11 @@ vrrp_script check-haproxy { 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 %} + + } dont_track_primary interface {{ LB_IF }} virtual_router_id {{ ROUTER_ID }}