<p>I'm trying to calculate dominant shares of resources in Kubernetes based on what Dominant Resource Fairness(DRF) does. How can I implement it in Kubernetes?</p>

HamiBU
<p>There are no specific set patterns or guidelines for DRF in Kubernetes yet. The closest that you can get to it is by trying to manage compute resources in <a href="https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/" rel="nofollow noreferrer">containers</a> together with what the <a href="https://kubernetes.io/docs/reference/command-line-tools-reference/kube-scheduler/" rel="nofollow noreferrer">kube-scheduler</a> does.  You can also start if you fetch all the pod requests and node capacities using <code>kubectl</code>.</p>

<p>As a matter of fact, the <a href="https://spark.apache.org/docs/latest/running-on-kubernetes.html" rel="nofollow noreferrer">Kubernetes Spark</a> native scheduler does something similar to that, you can probably start by looking at the <a href="https://github.com/apache/spark/tree/e9e8bb33ef9ad785473ded168bc85867dad4ee70/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/scheduler/cluster/k8s" rel="nofollow noreferrer">source code</a>.</p>

<p>If you don't want to use Kubernetes you can either use <a href="http://mesos.apache.org/" rel="nofollow noreferrer">Mesos</a> or <a href="https://hortonworks.com/blog/yarn-capacity-scheduler/" rel="nofollow noreferrer">YARN</a> that implement DRF natively.</p>
