I am trying to create k8s cluster with haproxy as external load balancer ( 2 haproxy nodes, 3 control planes , 3 workers) currently am still trying with 2 haproxy and 2 control planes
ERROR : connection between cluster and load balancer is not stable ,, sometimes its UP and then its DOWN again and going in cycles and I didn't understand why
Logs of the proxy image for logs
and when I try the cmd kubectl get nodes I get different errors (when haproxy is down )
kubectl get nodes
Unable to connect to the server: EOF
kubectl get nodes
Error from server: etcdserver: request timed out
kubectl get nodes
Error from server: etcdserver: leader changed
also I noticed the kube-apiserver pods have a high number of restarts.
kubectl get pods -n kube-system -l component=kube-apiserver
NAME READY STATUS RESTARTS AGE
kube-apiserver-updevopskm2 1/1 Running 3742 (6m12s ago) 5d3h
kube-apiserver-updevopskm3 1/1 Running 4037 (5m56s ago) 5d2h
this is my haproxy.cfg file
frontend apiserver
bind *:6443
mode tcp
option tcplog
default_backend apiserverbackendbackend apiserverbackend
mode tcp
option tcp-check
balance roundrobin
default-server inter 10s downinter 5s rise 2 fall 2 slowstart 60s maxconn 250 maxqueue 256 weight 100
server updevopskm2 ip:6443 check
server updevopskm3 ip:6443 check
i couldn't find any relevant solution