简体   繁体   English

关于每个节点限制100个pod的问题

[英]Question about 100 pods per node limitation

I'm trying to build a web app where each user gets their own instance of the app, running in its own container. 我正在尝试构建一个Web应用程序,每个用户都可以在各自的容器中运行自己的应用程序实例。 I'm new to kubernetes so I'm probably not understanding something correctly. 我是kubernetes的新手,所以我可能无法正确理解某些内容。

I will have a few physical servers to use, which in kubernetes as I understand are called nodes. 我将要使用一些物理服务器,据我所知在kubernetes中称为节点。 For each node, there is a limitation of 100 pods. 对于每个节点,限制为100个窗格。 So if I am building the app so that each user gets their own pod, will I be limited to 100 users per physical server? 因此,如果我正在构建应用程序,以便每个用户都有自己的Pod,那么每个物理服务器是否会限制为100个用户? (If I have 10 servers, I can only have 500 users?) I suppose I could run multiple VMs that act as nodes on each physical server but doesn't that defeat the purpose of containerization? (如果我有10台服务器,那么我只能有500个用户?)我想我可以在每个物理服务器上运行多个充当节点的VM,但这不会破坏容器化的目的吗?

The main issue in having too many pods in a node is because it will degrade the node performance and makes is slower(and sometimes unreliable) to manage the containers, each pod is managed individually, increasing the amount will take more time and more resources. 节点中有太多Pod的主要问题是,这会降低节点性能,并使管理容器的速度变慢(有时甚至不可靠),每个Pod是单独管理的,增加数量将花费更多的时间和更多的资源。

When you create a POD, the runtime need to keep a constant track, doing probes (readiness and Liveness), monitoring, Routing rules many other small bits that adds up to the load in the node. 创建POD时,运行时需要保持恒定的跟踪,进行探测(准备状态和活动性),监视,路由规则,这些规则会影响许多其他小的位,这些总加起来会增加节点的负载。

Containers also requires processor time to run properly, even though you can allocate fractions of a CPU, adding too many containers\\pod will increase the context switch and degrade the performance when the PODs are consuming their quota. 容器还需要处理器时间才能正常运行,即使您可以分配CPU的一部分,添加过多的容器\\ pod也会增加上下文切换并降低POD消耗其配额时的性能。

Each platform provider also set their own limits to provide a good quality of service and SLAs, overloading the nodes is also a risk, because a node is a single point of failure, and any fault in high density nodes might have a huge impact in the cluster and applications. 每个平台提供商还设置了自己的限制,以提供良好的服务质量和SLA,节点超载也是一个风险,因为节点是单点故障,并且高密度节点中的任何故障都可能对节点产生巨大影响。集群和应用程序。

You should either consider: 您应该考虑:

  • Smaller nodes and add more nodes to the cluster or 较小的节点并向群集添加更多节点,或者
  • Use Actors instead, where each client will be one Actor. 请改用Actor,因为每个客户都是一个Actor。 And many actor will be running in a single container. 并且许多actor将在单个容器中运行。 To make it more balanced around the cluster, you partition the actors into multiple containers instances. 为了使它在集群中更加平衡,您可以将参与者划分为多个容器实例。

Regarding the limits, this thread has a good discussion about the concerns 关于限制, 该主题对关注点进行了很好的讨论

Because of the hard limit if you have 10 servers you're limited to 1000 pods . 由于硬限制, 如果您有10台服务器,则只能使用1000个Pod

You might want to count also control plane pods in your 1000 available pods. 您可能还想在1000个可用吊舱中算出控制平面吊舱。 Usually located in the namespace kube-system it can include (but is not limited to) : 通常位于命名空间kube-system它可以包括(但不限于):

  • node log exporters (1 per node) 节点日志导出器(每个节点1个)
  • metrics exporters 指标导出器
  • kube proxy (usually 1 per node) kube代理(通常每个节点1个)
  • kubernetes dashboard kubernetes仪表板
  • DNS (scaling according to the number of nodes) DNS(根据节点数扩展)
  • controllers like certmanager 像certmanager这样的控制器

A pretty good rule of thumb could be 80-90 application pods per node, so 10 nodes will be able to handle 800-900 clients considering you don't have any other big deployment on those nodes. 一个很好的经验法则是每个节点80-90个应用程序容器,因此,如果您在这些节点上没有任何其他大型部署,那么10个节点将能够处理800-900个客户端。


If you're using containers in order to gain perfs, creating node VMs will be against your goal. 如果您使用容器来获得性能,则创建节点VM将违反您的目标。 But if you're using containers as a way to deploy coherent environments and scale stateless applications then using VMs as node can make sense. 但是,如果您使用容器作为部署一致环境和扩展无状态应用程序的方法,则将VM作为节点可能是有意义的。

There are no magic rules and your context will dictate what to do. 没有魔术规则,您的情况将决定要做什么。

As managing a virtualization cluster and a kubernetes cluster may skyrocket your infrastructure complexity, maybe kubernetes is not the most efficient tool to manage your workload. 由于管理虚拟化集群 kubernetes集群可能使您的基础架构复杂性急剧上升,因此kubernetes可能不是管理工作负载的最有效工具。

You may also want to take a look at Nomad wich does not seem to have those kind of limitations and may provide features that are closer to your needs. 您可能还想看看Nomad,它似乎没有那种局限性,并可能提供更符合您需求的功能。

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

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