offline-kubernetes-install/keepalived/keepalived1.conf
2023-09-13 10:45:29 +08:00

36 lines
1.2 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 BACKUP # 3个实例1个配置MASTER另外2个配置BACKUP, 非抢占式配置BACKUP
interface __NETWORK_NIC__
virtual_router_id 251 # ID主备需一致
priority 100 # 默认权重3个节点保持不一致并且MASTER最大priority之间的差值要小于weight
nopreempt # 非抢占式
authentication {
auth_type PASS # 主备验证信息,需一致
auth_pass 123456
}
track_script {
check
}
unicast_src_ip __MASTER1__
unicast_peer {
__MASTER2__
__MASTER3__
}
virtual_ipaddress {
__VIP__ dev __NETWORK_NIC__
}
}