What happens when the Kubernetes master fails?

主宰稳场 提交于 2020-03-17 04:28:11

问题


I've been trying to figure out what happens when the Kubernetes master fails in a cluster that only has one master. Do web requests still get routed to pods if this happens, or does the entire system just shut down?

According to the OpenShift 3 documentation, which is built on top of Kubernetes, (https://docs.openshift.com/enterprise/3.2/architecture/infrastructure_components/kubernetes_infrastructure.html), if a master fails, nodes continue to function properly, but the system looses its ability to manage pods. Is this the same for vanilla Kubernetes?


回答1:


It's my understanding that the master runs the API, and now (since 1.3?) Manages the underlying cloud infrastructure. When it is offline, the API will be offline, so the cluster ceases to be a cluster and is instead a bunch of ad-hoc nodes for this period. The cluster will not be able to respond to node failures, create new resources, move pods to new nodes, etc. Until the master is back online.

However, in any case, life for applications will continue as normal unless nodes are rebooted, or there is a dramatic failure of some sort during this time, because TCP/ UDP services, load balancers, DNS, the dashboard, etc. Should all continue to function.

If a node is rebooted, DNS queries may not resolve correctly until the master comes back online.

If you'd like to test this out yourself, I recommend kubeadm-dind-cluster or kind.




回答2:


Kubernetes cluster without a master is like a company running without a Manager.

No one else can instruct the workers(k8s components) other than the Manager(master node)
(even you, the owner of the cluster, can only instruct the Manager)

Everything works as usual. Until the work is finished or something stopped them.(because the master node died after assigning the works)

As there is no Manager to re-assign any work for them, the workers will wait and wait until the Manager comes back.

The best practice is to assign multiple managers(master) to your cluster.



来源:https://stackoverflow.com/questions/39172131/what-happens-when-the-kubernetes-master-fails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!