offline-kubernetes-install/keepalived/keepalived2.conf

35 lines
940 B
Plaintext
Raw Normal View History

2023-04-26 20:09:46 +08:00
global_defs {
script_user root # 脚本执行者
enable_script_security # 标记脚本安全
}
vrrp_script check {
script "killall -0 kube-apiserver" # 脚本路径
interval 2 # 脚本执行间隔单位s
weight -20 # -254-254之间检测失败权重减少
}
vrrp_instance VI_1 { # 实例名
state MASTER # 3个实例1个配置MASTER另外2个配置BACKUP
interface ens192
virtual_router_id 251 # ID主备需一致
priority 99
authentication {
auth_type PASS # 主备验证信息,需一致
auth_pass 123456
}
track_script {
check
}
unicast_src_ip 10.0.0.12
unicast_peer {
10.0.0.11
10.0.0.13
}
virtual_ipaddress {
10.0.0.3 dev ens192
}
}