Charmed-Kubernetes/keepalived/templates/keepalived.conf

23 lines
612 B
Plaintext

vrrp_script chk_svc_port {
# returns 1 if connection is refused
script "/bin/bash -c '</dev/tcp/127.0.0.1/{{ service_port }}'"
# check every 2 seconds
interval {{ healthcheck_interval }}
# make sure master priority drops below backup priority on failure
weight 2
}
vrrp_instance VI_1 {
interface {{ network_interface }}
state {% if is_leader %}MASTER{% else %}BACKUP{% endif %}
priority {% if is_leader %}101{% else %}100{% endif %}
virtual_router_id {{ router_id }}
virtual_ipaddress {
{{ virtual_ip }}
}
track_script {
chk_svc_port
}
}