高可用集群测试

集群稳定性测试

关闭部分 master 节点

k8s-master1 关机, 在 k8s-master2 和 k8s-master3 中查看节点:

$ ksys get no
NAME          STATUS     ROLES    AGE   VERSION
k8s-master1   NotReady   master   23h   v1.14.0
k8s-master2   Ready      master   22h   v1.14.0
k8s-master3   Ready      master   22h   v1.14.0
k8s-node1     Ready      <none>   21h   v1.14.0
k8s-node2     Ready      <none>   21h   v1.14.0
k8s-node3     Ready      <none>   21h   v1.14.0
k8s-node4     Ready      <none>   21h   v1.14.0

dashboard中查看也仍然通畅。

可以看到, VIP (192.168.1.140, k8s-master-lb) 已经转移到 k8s-master2:

[root@k8s-master2 ~]# ip a
...
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 00:0c:29:c6:ea:aa brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.129/24 brd 192.168.1.255 scope global noprefixroute ens33
       valid_lft forever preferred_lft forever
    inet 192.168.1.140/32 scope global ens33
       valid_lft forever preferred_lft forever
    inet6 fe80::49c2:1a95:aab:494f/64 scope link noprefixroute
       valid_lft forever preferred_lft forever
...

重启所有节点

将所有虚拟机(所有 master 及 node)进行关闭后再启动, 可以看到所有节点正常运行:

$ ksys get no
NAME          STATUS   ROLES    AGE   VERSION
k8s-master1   Ready    master   23h   v1.14.0
k8s-master2   Ready    master   22h   v1.14.0
k8s-master3   Ready    master   22h   v1.14.0
k8s-node1     Ready    <none>   21h   v1.14.0
k8s-node2     Ready    <none>   21h   v1.14.0
k8s-node3     Ready    <none>   21h   v1.14.0
k8s-node4     Ready    <none>   21h   v1.14.0

MIT Licensed | Copyright © 2018-present 滇ICP备16006294号

Design by Quanzaiyu | Power by VuePress