简体   繁体   English

在同一台服务器上运行 Kubernetes 主节点和节点(在 Kubernetes 主节点上调度 pod)

[英]Running Kubernetes master and node on the same server (scheduling pods on Kubernetes master)

If you run taint command on Kubernetes master:如果您在 Kubernetes master 上运行 taint 命令:

kubectl taint nodes --all node-role.kubernetes.io/master-

it allows you to schedule pods.它允许您安排 pod。 So it acts as node and master.所以它充当节点和主节点。

I have tried to run 3 server cluster where all nodes have both roles.我试图运行 3 个服务器集群,其中所有节点都有两个角色。 I didn't notice any issues from the first look.从第一眼看,我没有注意到任何问题。

Do you think nowadays this solution can be used to run small cluster for production service?你认为现在这个解决方案可以用来运行生产服务的小集群吗? If not, what are the real downsides?如果不是,真正的缺点是什么? In which situations this setup fails comparing with standard setup?与标准设置相比,此设置在哪些情况下会失败?

Assume that etcd is running on all three servers.假设 etcd 在所有三台服务器上都运行。

Thank you谢谢

The standard reason to run separate master nodes and worker nodes is to keep a busy workload from interfering with the cluster proper.运行单独的主节点和工作节点的标准原因是为了防止繁忙的工作负载干扰集群。

Say you have three nodes as proposed.假设您有建议的三个节点。 One winds up running a database;一个最终运行一个数据库; one runs a Web server;一个运行 Web 服务器; the third runs an asynchronous worker pod.第三个运行一个异步工作 pod。 Suddenly you get a bunch of traffic into your system, the Rails application is using 100% CPU, the Sidekiq worker is cranking away at 100% CPU, the MySQL database is trying to handle some complicated joins and is both high CPU and also is using all of the available disk bandwidth.突然间,您的系统收到了大量流量,Rails 应用程序使用了 100% CPU,Sidekiq 工作程序正在使用 100% CPU,MySQL 数据库正在尝试处理一些复杂的连接,既占用大量 CPU 资源,也正在使用所有可用的磁盘带宽。 You run kubectl get pods : which node is actually able to service these requests?您运行kubectl get pods :哪个节点实际上能够为这些请求提供服务? If your application triggers the Linux out-of-memory killer, can you guarantee that it won't kill etcd or kubelet , both of which are critical to the cluster working?如果您的应用程序触发了 Linux 内存不足杀手,您能保证它不会杀死etcdkubelet ,这两者对集群的工作都至关重要吗?

If this is running in a cloud environment, you can often get away with smaller (cheaper) nodes to be the masters.如果它在云环境中运行,您通常可以使用较小(更便宜)的节点作为主节点。 (Kubernetes on its own doesn't need a huge amount of processing power, but it does need it to be reliably available.) (Kubernetes 本身不需要大量的处理能力,但它确实需要它可靠地可用。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM