haerror haproxy 配置
cat /etc/haproxy/haproxy.cfg
global
log /dev/log local0 warning
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
daemon
stats socket /var/lib/haproxy/stats
defaults
log global
option httplog
option dontlognull
timeout connect 5000
timeout client 50000
timeout server 50000
frontend kube-apiserver
bind *:6443
mode tcp
option tcplog
default_backend kube-apiserver
frontend kube-console
bind *:30880
mode tcp
option tcplog
default_backend kube-console
backend kube-apiserver
mode tcp
option tcplog
option tcp-check
balance roundrobin
default-server inter 10s downinter 5s rise 2 fall 2 slowstart 60s maxconn 250 maxqueue 256 weight 100
server kube-apiserver-1 172.16.0.4:6443 check # Replace the IP address with your own.
server kube-apiserver-2 172.16.0.5:6443 check # Replace the IP address with your own.
server kube-apiserver-3 172.16.0.6:6443 check # Replace the IP address with your own.
server kube-apiserver-1 192.168.1.170:6443 check on-marked-down shutdown-sessions# Replace the IP address with your own.
server kube-apiserver-2 192.168.1.148:6443 check on-marked-down shutdown-sessions# Replace the IP address with your own.
server kube-apiserver-3 192.168.1.147:6443 check on-marked-down shutdown-sessions# Replace the IP address with your own.
backend kube-console
mode tcp
option tcplog
option tcp-check
balance roundrobin
default-server inter 10s downinter 5s rise 2 fall 2 slowstart 60s maxconn 250 maxqueue 256 weight 100
server kube-apiserver-1 172.16.0.4:6443 check # Replace the IP address with your own.
server kube-apiserver-2 172.16.0.5:6443 check # Replace the IP address with your own.
server kube-apiserver-3 172.16.0.6:6443 check # Replace the IP address with your own.
server kube-console-1 192.168.1.170:30880 check on-marked-down shutdown-sessions# Replace the IP address with your own.
server kube-console-2 192.168.1.148:30880 check on-marked-down shutdown-sessions# Replace the IP address with your own.
server kube-console-3 192.168.1.147:30880 check on-marked-down shutdown-sessions# Replace the IP address with your own.