Add some work on loadbalancer
This commit is contained in:
parent
507bdfca63
commit
b2e96c59da
3 changed files with 47 additions and 2 deletions
33
templates/etc/keepalived/keepalived.conf.j2
Normal file
33
templates/etc/keepalived/keepalived.conf.j2
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
! Configuration File for keepalived
|
||||
global_defs {
|
||||
router_id LVS_DEVEL
|
||||
}
|
||||
|
||||
vrrp_script check_apiserver {
|
||||
script "/etc/keepalived/check_apiserver.sh"
|
||||
interval 3
|
||||
weight -2
|
||||
fall 10
|
||||
rise 2
|
||||
}
|
||||
|
||||
vrrp_instance VI_1 {
|
||||
state {{ item.state }}
|
||||
interface {{ item.interface }}
|
||||
virtual_router_id 51
|
||||
{% if item.state == "MASTER" %}
|
||||
priority 101
|
||||
{% elif item.state == "BACKUP" %}
|
||||
priority 100
|
||||
{% endif %}
|
||||
authentication {
|
||||
auth_type PASS
|
||||
auth_pass {{ item.auth_pass }}
|
||||
}
|
||||
virtual_ipaddress {
|
||||
{{ item.lbip }}
|
||||
}
|
||||
track_script {
|
||||
check_apiserver
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue