简体   繁体   English

具有不同CPU配置的Kubernetes集群

[英]Kubernetes Cluster with different CPU configuration

I have created a K8S cluster of 10 machines. 我创建了一个由10台计算机组成的K8S集群。 which is having cpus of different memory and cores (4 core 32 GB, 4 core 8 GB). 它具有不同内存和内核(4内核32 GB,4内核8 GB)的cpus。 Now when I am deploying any application on the cluster it is creating pods in a random manner. 现在,当我在集群上部署任何应用程序时,它是以随机方式创建容器的。 It is not creating the POD on the basis of memory or load. 它不是基于内存或负载来创建POD。 How is Kubernetes master distributing the Pods in the cluster? Kubernetes大师如何在集群中分配Pod? I am not getting any significant answers. 我没有得到任何重要的答案。 How can i configure the cluster for best use of resources? 如何配置群集以最佳利用资源?

Kubernetes uses a scheduler for deciding which pod is started on which node. Kubernetes使用调度程序来决定哪个pod在哪个节点上启动。 One improvement is to tell the scheduler what your pods need as minimum and maximum resources. 一种改进是告诉调度程序您的吊舱需要什么作为最小和最大资源。

Resources are Memory (measured in bytes), CPU (measured in cpu units) and ephemeral storage for things like emtpy dir(with 1.11). 资源包括诸如emtpy dir(含1.11)之类的内存(以字节为单位),CPU(以cpu为单位)和临时存储。 When you provide these information for your deployments Kubernetes can make better decisions where to run. 在为部署提供这些信息时,Kubernetes可以做出更好的决策,在哪里运行。 Without these information a nginx pod will be scheduled the same way as any heavy Java application. 没有这些信息,nginx pod的调度方式将与任何繁重的Java应用程序相同。

The limits and requests config is described here . 限制和请求配置在此处描述。 Setting both limits is a good idea to make scheduling easier and to avoid pods running amok and using all node resources. 设置两个限制是一个好主意,可以使调度更加容易,并避免Pod运行amok和使用所有节点资源。

If this is not enough there is also the possibility to add a custom scheduler which is explained in this documentation 如果这还不够,则还可以添加自定义调度程序,本文档对此进行了说明。

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

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