mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 04:54:54 +00:00
Currently, the NodeResourcesFit plugin always returns Unschedulable when a pod's resource requests exceed a node's available resources. However, when a pod's requests exceed the node's total allocatable, preemption cannot help since even an empty node would not have enough resources. This change modifies the NodeResourcesFit plugin to return UnschedulableAndUnresolvable when a pod's resource requests exceed the node's total allocatable. This helps optimize the scheduling process in large clusters by: 1. Reducing the number of candidate nodes that need to be considered for preemption 2. Providing clearer feedback about unresolvable resource constraints 3. Improving scheduling performance by avoiding unnecessary preemption calculations The change is particularly beneficial in heterogeneous clusters where node sizes vary significantly, as it helps quickly identify nodes that are fundamentally too small for certain pods. Fixes https://github.com/kubernetes/kubernetes/issues/131310 Co-authored-by: Kensei Nakada <handbomusic@gmail.com>