简体   繁体   English

异构kubernetes集群,容器性能差异

[英]heterogeneous kubernetes cluster, container performance difference

Suppose there is a k8s cluster which is made up of nodes of different hardware specs .假设有一个 k8s 集群,它由不同硬件规格节点组成

Then 2 pods are allocated to 2 different nodes.然后将 2 个 pod 分配给 2 个不同的节点。

Suppose the container in the pod had specified 1000m cpu .假设 pod 中的容器指定了1000m cpu

Could the two containers running on those 2 different nodes show different levels of performance?在这两个不同节点上运行的两个容器是否会显示不同的性能水平?

To ask more directly: in a heterogeneous k8s cluster, could containers perform differently(iops, cpu, mem, etc) due to which node it happens to be allocated to?更直接地问:在异构 k8s 集群中,容器是否会因为它恰好分配到哪个节点而执行不同的(iops、cpu、mem 等)?

Yes.是的。 If two Pods both specify eg 1000m CPU and they run on different nodes, they both get an equivalent of 1 CPU core on their node.如果两个 Pod 都指定了例如 1000m CPU 并且它们在不同的节点上运行,则它们都在其节点上获得了 1 个 CPU 内核。 If one node has a faster CPU than the other node, then the Pod on this node correspondingly runs faster.如果一个节点的 CPU 比另一个节点快,那么这个节点上的 Pod 就会相应地运行得更快。

The same applies for other hardware characteristics of the nodes, eg the availability of a GPU, the speed of the memory and cache, etc.这同样适用于节点的其他硬件特性,例如 GPU 的可用性、内存和缓存的速度等。

If you want a more deterministic behaviour, you can categorise your nodes with labels or assign taints to them.如果您想要更具确定性的行为,您可以使用标签对节点进行分类或为它们分配污点 Then, on the Pod side, you can influence what node a Pod gets scheduled to with tolerations , node selectors , node affinities , or even a custom scheduler .然后,在 Pod 端,您可以通过tolerationsnode selectorsnode affinities甚至自定义调度程序来影响 Pod 被调度到哪个节点。

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

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