简体   繁体   English

如何在 Kubernetes 中对 Pod 进行排队?

[英]How to queue pods in Kubernetes?

I am new to Kubernetes and I am facing some issues.我是 Kubernetes 的新手,我面临一些问题。

The project codebase in bitbucket and in each commit, there are pipelines in bitbucket which build a pod in the Kubernetes cluster. bitbucket 中的项目代码库,在每次提交中,bitbucket 中都有管道,用于在 Kubernetes 集群中构建一个 pod。 So the pods do some tasks and terminate after the task got completed.因此 Pod 会执行一些任务并在任务完成后终止。 When the commits are high cluster fails due to a large number of pods.当提交量很高时,集群会因大量 pod 而失败。 So I am trying to find a solution to queue it in the Kubernetes cluster so the pods will use all the resources of my cluster after the termination of the pods it will run the other pods in the queue and so on.因此,我试图找到一种解决方案,将其在 Kubernetes 集群中排队,以便 pod 将在 pod 终止后使用我集群的所有资源,它将运行队列中的其他 pod,依此类推。 Any help?有什么帮助吗?

You can set pod resource requirements so that when you create a pod and requirements cannot be satisfied, scheduler will put it in pending state and schedule it as soon as there are available resources.您可以设置pod 资源需求,这样当您创建一个 pod 并且无法满足需求时,调度程序会将其置于待处理状态并在有可用资源时立即调度。

The only downfall of this solution is that it does not guarantee that pods will be created in the same order as api request sent to create them.这个解决方案的唯一缺点是它不能保证 pod 的创建顺序与发送来创建它们的 api 请求相同。

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

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