Add keepalived element
This element will be needed for HA deployments Change-Id: Ice66cc490abaf54109c0678296055d111ef69f4c
This commit is contained in:
parent
0a9ac8bfc7
commit
8380989be7
14
elements/keepalived/README.md
Normal file
14
elements/keepalived/README.md
Normal file
@ -0,0 +1,14 @@
|
||||
Element to install keepalived
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
keepalived:
|
||||
keepalive_interface: eth0
|
||||
- interface used for VRRP traffic
|
||||
virtual_ips:
|
||||
- you can define one or more virtual IPs including IPv6:
|
||||
- ip: 192.0.2.254/24
|
||||
interface: eth0
|
||||
- ip: fe80::5cc1:afff:fe58:143b/64
|
||||
interface: br-ctlplane
|
9
elements/keepalived/install.d/76-keepalived
Executable file
9
elements/keepalived/install.d/76-keepalived
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -eux
|
||||
|
||||
install-packages keepalived
|
||||
|
||||
if [ "$DIB_INIT_SYSTEM" == "systemd" ] ; then
|
||||
systemctl enable keepalived.service
|
||||
fi
|
@ -0,0 +1,20 @@
|
||||
vrrp_script chk_haproxy {
|
||||
script "killall -0 haproxy"
|
||||
interval 2
|
||||
weight 2
|
||||
}
|
||||
|
||||
vrrp_instance VI_1 {
|
||||
interface {{keepalived.keepalive_interface}}
|
||||
state MASTER
|
||||
virtual_router_id 51
|
||||
priority {{keepalived.priority}} # 101 on master, 100 on backup
|
||||
virtual_ipaddress {
|
||||
{{#virtual_ips}}
|
||||
{{ip}} dev {{interface}}
|
||||
{{/virtual_ips}}
|
||||
}
|
||||
track_script {
|
||||
chk_haproxy
|
||||
}
|
||||
}
|
4
elements/keepalived/os-refresh-config/post-configure.d/15-keepalived
Executable file
4
elements/keepalived/os-refresh-config/post-configure.d/15-keepalived
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
set -eux
|
||||
|
||||
service keepalived restart
|
Loading…
Reference in New Issue
Block a user