vrrp_script chk_ocp {
    script "curl -o /dev/null -kLs https://0:6443/readyz"
    interval 1
    weight 50
}

vrrp_script chk_dns {
    script "host -t SRV _etcd-server-ssl._tcp.{{.Cluster.Domain}} localhost"
    interval 1
    weight 50
}

vrrp_script chk_ingress {
    script "curl -o /dev/null -kLs https://0:1936/healthz"
    interval 1
    weight 50
}

vrrp_instance {{.Cluster.Name}}_API {
    state BACKUP
    interface {{.VRRPInterface}}
    virtual_router_id {{.Cluster.APIVirtualRouterID}}
    priority 40
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass {{.Cluster.Name}}_api_vip
    }
    virtual_ipaddress {
        {{.Cluster.APIVIP}}/{{.Cluster.VIPNetmask}}
    }
    track_script {
        chk_ocp
    }
}

vrrp_instance {{.Cluster.Name}}_INGRESS {
    state BACKUP
    interface {{.VRRPInterface}}
    virtual_router_id {{.Cluster.IngressVirtualRouterID}}
    priority 40
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass cluster_uuid_ingress_vip
    }
    virtual_ipaddress {
        {{.Cluster.IngressVIP}}/{{.Cluster.VIPNetmask}}
    }
    track_script {
        chk_ingress
    }
}
