首页 新闻 会员 周边

k8s集群3台master只启动1台无法正常工作

0
悬赏园豆:100 [待解决问题]

用 3 台 master 搭建 kubernetes 高可用集群,将 3 台 master 都关机后,如果只启动其中1台,运行 kubectl 命令时总是报下面的错误:

The connection to the server k8s-api:6443 was refused - did you specify the right host or port?

只要再启动1台,就恢复正常,难道高可用集群一定要至少 2 台 master 正常运行吗?

k8s
问题补充:

今天发现是因为 api-server 在这台服务器上无法启动

dudu的主页 dudu | 高人七级 | 园豆:30994
提问于:2019-12-20 23:06
< >
分享
所有回答(2)
0

我猜是重启的顺序搞错了

风浪 | 园豆:2996 (老鸟四级) | 2019-12-23 12:58
0

在 stackoverflow 上找到了答案,当一共有 3 个 master 节点时,至少需要 2 个节点可用,api-server 才可以正常工作。

Kubernetes API works as long as Etcd cluster works. Etcd cluster works when there is quorum, so at least 2 of 3 Etcd pods are alive. If only 1 of 3 Etcd pod is alive - cluster goes to read-only state when no new pods can be scheduled and no resource creates/updates/deletes are allowed.

dudu | 园豆:30994 (高人七级) | 2020-01-07 18:03

The Ultimate Guide to Disaster Recovery for Your Kubernetes Clusters 这篇博文中也提到了:

We are running 3 master Kubernetes cluster with 3 etcd members running on each master. If we lose one master, we can still recover the master because etcd quorum is intact. Now if we lose two masters, we need a mechanism to recover from such situations as well for production grade clusters.

支持(0) 反对(0) dudu | 园豆:30994 (高人七级) | 2020-01-07 18:06
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册