K8S Scheduling

K8S SchedulerK8S Scheduler
[[Kubernetes]] scheduler is a [[K8S Master Node]] component in charge of [[K8S Scheduling]].



Status: #🌱

References:
is making sure that every K8S PodK8S Pod
Pod is a [[K8S Object]] used to run one or more tightly coupled containers and is rarely used directly, especially in production because of the limitations on the number of properties that can be u...
is assigned to a K8S NodeK8S Node
In [[Kubernetes]], a Node is a (physical or virtual) machine in charge of running some workloads. Kubernetes is run entirely on nodes, and everything that happens on Kubernetes cluster, happens on ...
. Every pod that gets created has a property NodeName which is not set by default. kube-scheduler looks for pods with these fields unset and assigns them a node by setting the NodeName property.

The Pods are created before they are scheduled, and since the NodeName field is immutable, Scheduler can't just edit the pod. It has to create a K8S Binding Object and create a post request to the K8S ApiserverK8S Apiserver
Kube Apiserver is the primary component of a [[Kubernetes]] cluster. It runs on a [[K8S Master Node]], and is the only component which is talking directly to the [[etcd cluster]]. It exposes a REST...
.

There are multiple constraints that scheduler needs to take into consideration while deciding where to place a pod:

  • 01 Inbox/K8S Resource Requests and Limits
  • K8S Node SelectorsK8S Node Selectors
    Node Selectors are used to place [[K8S Pod]]s on specific [[K8S Node]] by label. For more complex placement options, see K8S Node AffinityK8S Node Affinity
    Node Affinity is a feature which ensures that [[K8S Pod]] end up running on specific [[K8S Node]]. We are already able to do this with [[K8S Node Selectors]], but with big limitations.

    See also [[...
    .

    It's possible to make a pod go to a specific node ba...
  • K8S Node AffinityK8S Node Affinity
    Node Affinity is a feature which ensures that [[K8S Pod]] end up running on specific [[K8S Node]]. We are already able to do this with [[K8S Node Selectors]], but with big limitations.

    See also [[...
  • K8S Taints and Tolerations

If there were no kube-scheduler on the cluster, you could create the pod with the NodeName already set.


Status: #💡