Scheduling Policies
You can set a scheduling policy by running or kube-scheduler --policy-configmap <ConfigMap>
and using the Policy type.
The following predicates implement filtering:
PodFitsHostPorts
: Checks if a Node has free ports (the network protocol kind) for the Pod ports the Pod is requesting.PodFitsHost
: Checks if a Pod specifies a specific Node by its hostname.PodFitsResources
: Checks if the Node has free resources (eg, CPU and Memory) to meet the requirement of the Pod.PodMatchNodeSelector
: Checks if a Pod’s Node matches the Node’s label(s)Tags objects with identifying attributes that are meaningful and relevant to users. .NoVolumeZoneConflict
: Evaluate if the that a Pod requests are available on the Node, given the failure zone restrictions for that storage.NoDiskConflict
: Evaluates if a Pod can fit on a Node due to the volumes it requests, and those that are already mounted.CheckNodePIDPressure
: If a Node is reporting that process IDs are scarce, and there’s no configured exception, the Pod won’t be scheduled there.CheckNodeDiskPressure
: If a Node is reporting storage pressure (a filesystem that is full or nearly full), and there’s no configured exception, the Pod won’t be scheduled there.CheckNodeCondition
: Nodes can report that they have a completely full filesystem, that networking isn’t available or that kubelet is otherwise not ready to run Pods. If such a condition is set for a Node, and there’s no configured exception, the Pod won’t be scheduled there.PodToleratesNodeTaints
: checks if a Pod’s tolerationsA core object consisting of three required properties: key, value, and effect. Tolerations enable the scheduling of pods on nodes or node groups that have a matching taint. can tolerate the Node’s .CheckVolumeBinding
: Evaluates if a Pod can fit due to the volumes it requests. This applies for both bound and unbound PVCsClaims storage resources defined in a PersistentVolume so that it can be mounted as a volume in a container. .
The following priorities implement scoring:
SelectorSpreadPriority
: Spreads Pods across hosts, considering Pods that belong to the same , StatefulSetManages deployment and scaling of a set of Pods, with durable storage and persistent identifiers for each Pod. or .InterPodAffinityPriority
: Implements preferred inter pod affininity and antiaffinity.LeastRequestedPriority
: Favors nodes with fewer requested resources. In other words, the more Pods that are placed on a Node, and the more resources those Pods use, the lower the ranking this policy will give.BalancedResourceAllocation
: Favors nodes with balanced resource usage.NodePreferAvoidPodsPriority
: Prioritizes nodes according to the node annotationscheduler.alpha.kubernetes.io/preferAvoidPods
. You can use this to hint that two different Pods shouldn’t run on the same Node.NodeAffinityPriority
: Prioritizes nodes according to node affinity scheduling preferences indicated in PreferredDuringSchedulingIgnoredDuringExecution. You can read more about this in .TaintTolerationPriority
: Prepares the priority list for all the nodes, based on the number of intolerable taints on the node. This policy adjusts a node’s rank taking that list into account.ImageLocalityPriority
: Favors nodes that already have the container imagesStored instance of a container that holds a set of software needed to run an application. for that Pod cached locally.ServiceSpreadingPriority
: For a given Service, this policy aims to make sure that the Pods for the Service run on different nodes. It favours scheduling onto nodes that don’t have Pods for the service already assigned there. The overall outcome is that the Service becomes more resilient to a single Node failure.: Gives an equal weight of one to all nodes.
EvenPodsSpreadPriority
: Implements preferred .
- Learn about scheduling
- Learn about
Thanks for the feedback. If you have a specific, answerable question about how to use Kubernetes, ask it on Stack Overflow. Open an issue in the GitHub repo if you want to or suggest an improvement.