Last active
December 11, 2018 06:01
-
-
Save yangl/16c096cbbaf9b0e71f44ac6fe6c98527 to your computer and use it in GitHub Desktop.
kubernetes master高可用:HAProxy + keepalived配置 公有云上由于默认禁用vrrp,要申请开放!腾讯云可使用HAVIP产品。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
log /dev/log local0 | |
log /dev/log local1 notice | |
chroot /var/lib/haproxy | |
stats socket /run/haproxy/admin.sock mode 660 level admin | |
stats timeout 30s | |
user haproxy | |
group haproxy | |
daemon | |
nbproc 1 | |
defaults | |
log global | |
timeout connect 5000 | |
timeout client 10m | |
timeout server 10m | |
listen kube-master | |
bind 0.0.0.0:8443 | |
mode tcp | |
option tcplog | |
balance roundrobin | |
server 172.16.16.13 172.16.16.13:6443 check inter 2000 fall 2 rise 2 weight 1 | |
server 172.16.16.14 172.16.16.14:6443 check inter 2000 fall 2 rise 2 weight 1 | |
listen ingress-node | |
bind 0.0.0.0:80 | |
mode tcp | |
option tcplog | |
balance roundrobin | |
server 172.16.16.15 172.16.16.15:23456 check inter 2000 fall 2 rise 2 weight 1 | |
server 172.16.16.16 172.16.16.16:23456 check inter 2000 fall 2 rise 2 weight 1 | |
listen ingress-node-tls | |
bind 0.0.0.0:443 | |
mode tcp | |
option tcplog | |
balance roundrobin | |
server 172.16.16.15 172.16.16.15:23457 check inter 2000 fall 2 rise 2 weight 1 | |
server 172.16.16.16 172.16.16.16:23457 check inter 2000 fall 2 rise 2 weight 1 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global_defs { | |
router_id lb-backup-172.16.16.14 | |
} | |
vrrp_script check-haproxy { | |
script "killall -0 haproxy" | |
interval 5 | |
weight -60 | |
} | |
vrrp_instance VI-kube-master { | |
state BACKUP | |
priority 101 | |
unicast_src_ip 172.16.16.14 | |
unicast_peer { | |
172.16.16.13 | |
} | |
dont_track_primary | |
interface eth0 | |
virtual_router_id 111 | |
advert_int 3 | |
track_script { | |
check-haproxy | |
} | |
virtual_ipaddress { | |
172.16.16.200 | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global_defs { | |
router_id lb-master | |
} | |
vrrp_script check-haproxy { | |
script "killall -0 haproxy" | |
interval 5 | |
weight -60 | |
} | |
vrrp_instance VI-kube-master { | |
state MASTER | |
priority 120 | |
unicast_src_ip 172.16.16.13 | |
unicast_peer { | |
172.16.16.14 | |
} | |
dont_track_primary | |
interface eth0 | |
virtual_router_id 111 | |
advert_int 3 | |
track_script { | |
check-haproxy | |
} | |
virtual_ipaddress { | |
172.16.16.200 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment