在具有haproxy的Kubernetes集群中,有2个主节点,1个节点。当master1关闭时,故障转移不起作用

时间:2020-10-24 16:54:50

标签: kubernetes

根据文档在Oracle VM上实现,但是故障转移不起作用。

https://github.com/justmeandopensource/kubernetes/tree/master/kubeadm-ha-multi-master

Role                    FQDN                    IP       OS             RAM CPU
Load Balancer   loadbalancer.example.com172.16.16.100   Ubuntu 20.04    1G  1
Master          kmaster1.example.com    172.16.16.101   Ubuntu 20.04    2G  2
Master          kmaster2.example.com    172.16.16.102   Ubuntu 20.04    2G  2
Worker          kworker1.example.com    172.16.16.201   Ubuntu 20.04    1G  1

Below are the details before shutting down the kmaster1 and after. 

root@kmaster2:~# kubectl get nodes
NAME       STATUS   ROLES    AGE   VERSION
kmaster1   Ready    master   22h   v1.19.2
kmaster2   Ready    master   22h   v1.19.2
kworker1   Ready    <none>   22h   v1.19.2
===>shutdown now on master1-========
root@kmaster2:~# kubectl get nodes
Error from server: etcdserver: request timed out
root@kmaster2:~# kubectl get nodes
Error from server: etcdserver: request timed out
root@kmaster2:~# ping 172.16.16.100
PING 172.16.16.100 (172.16.16.100) 56(84) bytes of data.
64 bytes from 172.16.16.100: icmp_seq=1 ttl=64 time=0.580 ms
64 bytes from 172.16.16.100: icmp_seq=2 ttl=64 time=0.716 ms
64 bytes from 172.16.16.100: icmp_seq=3 ttl=64 time=1.08 ms
^C
--- 172.16.16.100 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2053ms
rtt min/avg/max/mdev = 0.580/0.792/1.081/0.211 ms
root@kmaster2:~# kubectl get nodes
Unable to connect to the server: net/http: TLS handshake timeout
root@kmaster2:~# kubectl get nodes
Unable to connect to the server: net/http: TLS handshake timeout 

0 个答案:

没有答案