在Kubernetes集群上缺乏共识的实际后果? [英] Practical consequences of missing consensus on a Kubernetes cluster?

查看:80
本文介绍了在Kubernetes集群上缺乏共识的实际后果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Kubernetes集群上缺乏共识的实际后果是什么?或者换句话说:Kubernetes集群上的哪些功能需要共识?什么有效,什么无效?

What exactly are the practical consequences of missing consensus on a Kubernetes cluster? Or in other words: which functions on a Kubernetes cluster require consensus? What will work, what won't work?

例如(并且实际上仅是示例):

For example (and really only for example):

  • 现有吊舱会继续运行吗?
  • 豆荚还可以水平缩放吗?

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

Example scenario: A cluster with two nodes loses one node. No consensus possible.

推荐答案

共识是etcd的基础-etcd是构建Kubernetes的分布式数据库.没有共识,您可以从数据库中读取,但不能写入.例如.如果只有3个节点中的1个可用.

Consensus is fundamental to etcd - the distributed database that Kubernetes is built upon. Without consensus you can read but not write from the database. E.g. if only 1 of 3 nodes is available.

当仲裁失败时,etcd进入只读状态,在该状态下它可以响应数据,但是由于无法确定是否允许该操作,因此无法进行任何新操作.

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共识以及如何从故障中恢复

Understanding Etcd Consensus and How to Recover from Failure

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

Kubernetes is designed so pods only need kubernetes for changes, e.g. deployment. After that they run independent of kubernetes in a loosely coupled fashion.

Kubernetes被构造为在etcd数据库中保持所需状态.然后控制器监视etcd的更改并根据更改采取行动.这意味着,如果etcd不一致,则无法缩放或更改任何Pod配置. Kubernetes会执行许多自我修复操作,但是如果etcd不可用,它们将无法工作,因为所有操作都是通过ApiServer和etcd完成的.

Kubernetes is contstructed for keeping desired state in the etcd database. Then controllers watch etcd for changes and act upon change. This means that you can not scale or change any configuration of pods if etcd doesn't have consensus. Kubernetes does many self-healing operations, but they will not work if etcd is not available since all operations is done through the ApiServer and etcd.

放弃法定人数意味着没有新动作.一切运行将继续运行,直到出现故障.

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

了解etcd和Kubernetes中的分布式共识

这篇关于在Kubernetes集群上缺乏共识的实际后果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆