简体   繁体   中英

How to set priority to kubernetes job object

I want to run multiple kubernetes jobs one job can run let say 10k pods to complete the finish the job.

I want to start multiple jobs simultaneously and want to control their execution based on priority ,

Example : if i have 3 jobs (job1,job2,job3) doesn't matter which job was created first but the job with highest priority should complete all the pod first.

I am not able to figure out what mechanism k8s is using for scheduling the job pods, i started two jobs with target of 300pods by each job and both the jobs started their pod execution simultaneously.

I want to control this behavior!!

您可以编写一个自定义的调度程序并将其用于您的特定工作舱,但这将需要大量的工作。

No. we don't have full control over the scheduler in k8s. If your use case or requirement does not fulfill by the current scheduler in k8s 1.6 will allow you to use custom scheduler as Advanced Scheduling in Kubernetes . Currently there is no priorities set to the pods. The issue is still open and this feature will come in future releases as mentioned in the comments of above ans by @Radek 'Goblin' Pieczonka https://github.com/kubernetes/kubernetes/issues/28928

However scheduler is configurable. It has two types of policies, FitPredicate (see kubernetes/plugin/pkg/scheduler/algorithm/predicates/predicates.go ) and PriorityFuction (see kubernetes/plugin/pkg/scheduler/algorithm/priorities/ ). You wil get to know most of the things. And, we'll see the priorities features in next stable build. Hope it helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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