Manish Jindal
Manish Jindal

Reputation: 405

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!!

Upvotes: 0

Views: 1972

Answers (2)

mohan08p
mohan08p

Reputation: 5362

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.

Upvotes: 0

You could write a custom scheduler and use it for your particular job pods, but it will require a significant amount of work.

Upvotes: 1

Related Questions