vrrp_script healthcheck {
        script "/etc/keepalived/healthcheck.sh"
        interval 10
        fall 2
        rise 2
        timeout 5
        init_fail
}
 global_defs {
        script_user root
        router_id harbor-ha
        enable_script_security
}
 vrrp_instance VI_1 {
        state  {{ if .groups.image_registry | first | eq .inventory_hostname }}MASTER{{ else }}BACKUP{{ end }}
        interface {{ .ha_vip_interface }}
        virtual_router_id 31
        priority 50
        advert_int 1
        authentication {
                auth_type PASS
                auth_pass k8s-test
        }
        virtual_ipaddress {
                {{ .image_registry.ha_vip }}
        }
        track_script {
                healthcheck
        }
 }
