DRA Preemption Alpha
The Issue & Context
Before this PR, Kubernetes scheduler could not preempt lower-priority pods holding exclusively allocated node-local devices in pod-owned ResourceClaims, preventing higher-priority pods from acquiring needed resources promptly.
Root Cause Analysis
The scheduler lacked logic to identify and preempt pods that hold exclusive node-local device claims, as existing preemption mechanisms did not account for device-specific resource claims managed through ResourceClaimTemplates.
Solution Strategy & Architectural Pattern
This PR implements the Dynamic Resource Allocation (DRA) preemption feature behind a feature gate, adding scheduler framework plugins that track device claims, identify victim pods holding exclusive devices, preempt them, and hold freed devices for the preemptor until scheduling completes. It focuses on pod-owned ResourceClaims with exclusive node-local devices and excludes standalone claims and shared resources in alpha.
Key Takeaway for Contributors
When extending scheduling preemption to specialized resources like node-local devices, it's critical to integrate resource claim tracking into preemption logic and hold resources atomically for the preemptor to prevent race conditions and ensure correct scheduling order.