<p>Kubernetes scheduler includes two parts: <strong>predicate</strong> and <strong>priority</strong>. The source code is in <em>kubernetes/plugin/pkg/scheduler</em>. I want to add a new priority algorithm to the default priorities. Can anyone guide me the detailed steps? Thanks a lot!</p>

<p>Maybe I should do the following steps:</p>

<ol>
<li>Add my own priority algorithm to the path: kubernetes/plugin/pkg/scheduler/algorithm/priorities</li>
<li>Register that priority algorithm</li>
<li>Build/Recompile the whole k8s project and install\deploy a new k8s cluster</li>
<li>Test if that priority effects, maybe give it a high weight.</li>
</ol>

<p>If there are more detailed articles and documents, it will help me a lot! 
The more detailed the better！Thanks a lot!</p>

<p><em>k8s version: 1.2.0, 1.4.0 or later.</em></p>

<p>You can run your scheduler as a kubernetes deployment.</p>

<p>Kelsey Hightower has an example scheduler coded up on <a href="https://github.com/kelseyhightower/scheduler" rel="nofollow noreferrer">Github</a></p>

<p>The meat and bones of this is here: <a href="https://github.com/kelseyhightower/scheduler/blob/master/bestprice.go" rel="nofollow noreferrer">https://github.com/kelseyhightower/scheduler/blob/master/bestprice.go</a></p>

<p>And the deployment yaml is <a href="https://github.com/kelseyhightower/scheduler/blob/master/deployments/scheduler.yaml" rel="nofollow noreferrer">here</a></p>

<p>Essentially, you can package it up as a docker container and deploy it. </p>

<p>Take note of the way you interact with the k8s API using <a href="https://github.com/kelseyhightower/scheduler/blob/master/kubernetes.go" rel="nofollow noreferrer">this package</a> in order to do it this way you'll need to have a similar wrapper, but it's much easier than building/recompiling the whole k8s package.</p>
