Clarification on Kubernetes QoS relation to scheduling

4/14/2021

According to https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/

Kubernetes uses QoS classes to make decisions about scheduling and evicting Pods.

I don't understand how do QoS classes have anything to do with scheduling? The documentation mentions that QoS classes determine eviction order in case of a node going out of resources.

On the other hand, scheduling uses pod priorities (PriorityClass) to set the scheduling order and preemption.

My question is what is the link between QoS and scheduling?

-- woj.sierak
kubernetes
qos

1 Answer

4/15/2021

My question is what is the link between QoS and scheduling?

According to https://kubernetes.io/docs/concepts/scheduling-eviction/kube-scheduler/

kube-scheduler selects a node for the pod in a 2-step operation:

Filtering
Scoring

The filtering step finds the set of Nodes where it's feasible to schedule the Pod. For example, the PodFitsResources filter checks whether a candidate Node has enough available resource to meet a Pod's specific resource requests. After this step, the node list contains any suitable Nodes; often, there will be more than one. If the list is empty, that Pod isn't (yet) schedulable.

In the scoring step, the scheduler ranks the remaining nodes to choose the most suitable Pod placement. The scheduler assigns a score to each Node that survived filtering, basing this score on the active scoring rules.

Finally, kube-scheduler assigns the Pod to the Node with the highest ranking. If there is more than one node with equal scores, kube-scheduler selects one of these at random.

So the QoS takes a role in Filtering step of kube-scheduler operation that corresponding PodFitsResources filter.

According to https://kubernetes.io/docs/reference/scheduling/policies/

PodFitsResources: Checks if the Node has free resources (eg, CPU and Memory) to meet the requirement of the Pod.

-- Tinh Huynh
Source: StackOverflow