“有“成千上万的容器”是什么意思?”

huangapple go评论46阅读模式
英文:

What does it mean to have "thousands of containers"

问题

我正在学习容器和Kubernetes。在观看关于容器和Kubernetes的教程时,通常讲师会说“您可以拥有数千个容器”。

我正在尝试理解我们如何最终拥有数千个容器?

在部署我的单一容器应用程序后,如何创建数千个容器实例?

英文:

I am starting on learning Containers and Kubernetes. When watching tutorials on Containers and Kubernetes, often the instructors says "You could have thousands of containers".

I am trying to understand how we can end up with thousands of containers?

After deploying my single container app, how thousands of container instances are created?

答案1

得分: 1

根据GSerg的建议,集群是由控制平面管理的运行Kubernetes代理的节点集合。您可以通过添加或移除节点来扩展您的集群。您如何执行此操作取决于您的集群部署方式。限制是300,000个容器。您可以在官方文档1中找到相关信息。

根据2文档:

但是,容器化应用程序可能会变得复杂。在生产环境中,许多应用程序可能需要在生产中运行数百到数千个单独的容器。这就是像Docker这样的容器运行时环境受益于使用其他工具来编排或管理所有正在运行的容器的地方。

用于此目的的最流行工具之一是Kubernetes,这是一个容器编排器,可以识别多个容器运行时环境,包括Docker。

运行容器的软件称为容器运行时。Kubernetes支持容器运行时,例如containerd、CRI-O以及Kubernetes CRI(容器运行时接口)的其他实现。

通常,您可以让您的集群选择Pod的默认容器运行时。如果您需要在集群中使用多个容器运行时,您可以为Pod指定RuntimeClass,以确保Kubernetes使用特定的容器运行时运行这些容器。使用RuntimeClass,您还可以使用相同的容器运行时来运行具有不同设置的多个Pod。

英文:

Adding to GSerg suggestion

A cluster is a set of nodes running Kubernetes agents, managed by the control plane.You can scale your cluster by adding or removing nodes. The way you do this depends on how your cluster is deployed. The limit is 300000 containers.You can find this in this official doc.

As per this doc

> Containerized applications can get complicated, however. When in
> production, many might require hundreds to thousands of separate
> containers in production. This is where container runtime environments
> such as Docker benefit from the use of other tools to orchestrate or
> manage all the containers in operation.
>
> One of the most popular tools for this purpose is Kubernetes, a
> container orchestrator that recognizes multiple container runtime
> environments, including Docker.

The software that runs containers is called the container runtime. Kubernetes upholds compartment runtimes, for example, containerd, CRI-O, and some other execution of the Kubernetes CRI (Holder Runtime Point of interaction).

Usually, you can let your cluster choose a Pod's default container runtime. You can specify the RuntimeClass for a Pod to ensure that Kubernetes runs those containers using a specific container runtime if you need to use more than one container runtime in your cluster. Using RuntimeClass, you can also use the same container runtime to run multiple Pods with different settings.

答案2

得分: 0

当您使用 Deployment 将容器化的应用部署到 Kubernetes 时,它们被设计为_无状态_。

无状态 应用的好处在于它们易于横向扩展。您可以使用 Horizontal Pod Autoscaler 在增加流量时自动创建更多的 Pod(实例)。

请注意,Horizontal Pod Autoscaler 仅扩展您的 Pods,最终您还需要扩展节点,但这必须由底层基础架构处理,例如 Google Kubernetes Engine - Autopilot 可以为您执行此操作。

英文:

When you deploy your containerized app to Kubernetes using a Deployment, they are meant to be stateless.

The good thing with stateless applications is that they are easy to scale out. You can use Horizontal Pod Autoscaler to automatically create more pods (instances) when you get increased traffic.

Note that the Horizontal Pod Autoscaler only scales out your Pods, you will eventually need to scale out your nodes too, but this must be handled by the underlying infrastructure, e.g. Google Kubernetes Engine - Autopilot can do this for you.

huangapple
  • 本文由 发表于 2023年4月19日 16:59:23
  • 转载请务必保留本文链接:https://go.coder-hub.com/76052597.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定