在 Kubernetes 集群上缺乏共识的实际后果?

Practical consequences of missing consensus on a Kubernetes cluster?

在 Kubernetes 集群上缺少共识的实际后果到底是什么?或者换句话说:Kubernetes 集群上的哪些功能需要共识?什么行得通,什么行不通?

例如(实际上只是为了举例):

示例场景:具有两个节点的集群丢失一个节点。不可能达成共识。

共识是 etcd 的基础 - Kubernetes 所基于的分布式数据库。如果没有达成共识,您可以 read 但不能 write 从数据库中。例如。如果 3 个节点中只有 1 个可用。

When you lose quorum etcd goes into a read only state where it can respond with data, but no new actions can take place since it will be unable to decide if the action is allowed.

了解 Etcd 共识以及如何从失败中恢复

Kubernetes 的设计 pods 只需要 kubernetes 进行更改,例如部署。之后,它们 运行 以松散耦合的方式独立于 kubernetes。

Kubernetes 的构建是为了在 etcd 数据库中保持所需状态。然后控制器观察 etcd 的变化并根据变化采取行动。这意味着如果 etcd 没有达成共识,您将无法扩展或更改 pods 的任何配置。 Kubernetes 有很多自愈操作,但如果 etcd 不可用,它们将无法工作,因为所有操作都是通过 ApiServer 和 etcd 完成的。

Loosing quorum means that no new actions can take place. Everything that is running will continue to run until there is a failure.

Understanding Distributed Consensus in etcd and Kubernetes