简体   繁体   English

Kubernetes是否在内部维护pods / jobs排队?

[英]Does Kubernetes internally maintain pods / jobs queue?

We are stuck with a big problem of kubernetes Queuing. 我们遇到了kubernetes排队的大问题。

We are submitting jobs through Workflow manager ie Airflow to cluster manager ie AWS Batch. 我们通过Workflow管理器提交作业,即Airflow到集群管理器,即AWS Batch。 Since there are limitations in AWS batch, irrespective of a number of jobs submitted to the queue, the batch was concurrently executing the number of jobs equal to vCPUs available in the cluster. 由于AWS批处理存在限制,因此无论提交到队列的作业数是多少,批处理都会同时执行与集群中可用的vCPU相等的作业数。 To overcome this limitation of AWS batch, we are planning to migrate to Kubernetes over AWS batch. 为克服AWS批次的这一限制,我们计划通过AWS批次迁移到Kubernetes。

But, we are not sure, how kubernetes handle this problem, On exploring, we are getting examples of the queue in following links. 但是,我们不确定kubernetes如何处理这个问题,在探索时,我们将在以下链接中获取队列的示例。

  1. https://kubernetes.io/docs/tasks/job/fine-parallel-processing-work-queue/ https://kubernetes.io/docs/tasks/job/fine-parallel-processing-work-queue/

  2. https://kubernetes.io/docs/tasks/job/coarse-parallel-processing-work-queue/ https://kubernetes.io/docs/tasks/job/coarse-parallel-processing-work-queue/

In these examples, it is required from us to write tasks to queue and read from the queue by our code. 在这些示例中,我们需要将任务写入队列并通过我们的代码从队列中读取。 But, the case explained here, is not what we are looking for. 但是,这里解释的案例并不是我们想要的。 In our case, Apache airflow's Kubernetes_Pod_operator will submit pod/job to K8 cluster, and we are expecting K8 will put these jobs in its internal queue and will pick up and will execute them on cluster based on the available cluster capacity. 在我们的例子中,Apache airflow的Kubernetes_Pod_operator将pod / job提交给K8集群,我们期望K8将这些作业放在其内部队列中,并将根据可用的集群容量在集群上执行它们。

  • We want to know, does k8 internally support queue and put the jobs/ pods in the queue, and picks up and executes them on cluster based on the available cluster capacity? 我们想知道,k8内部是否支持队列并将作业/ pod放入队列中,并根据可用的群集容量在群集上拾取并执行它们?

  • Any solution to this problem? 任何解决这个问题的方法? OR is it the limitation in k8, and we should develop our own solution to this? 或者它是k8的限制,我们应该开发自己的解决方案吗?

You can configure container resources in your job yamls. 您可以在作业yamls中配置容器资源。 Read the below link on how to achieve this: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#how-pods-with-resource-requests-are-scheduled 请阅读以下链接,了解如何实现此目的: https//kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#how-pods-with-resource-requests-are-scheduled

This configuration will make sure that the jobs remain in the 'Pending' state until the requirements are met. 此配置将确保作业保持在“待处理”状态,直到满足要求。 Kubernetes scheduler uses an internal queue where all 'Pending' and 'scheduler failed' jobs are stored. Kubernetes调度程序使用内部队列,其中存储所有“待处理”和“调度程序失败”作业。

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

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