Commit Graph

1940 Commits

Author SHA1 Message Date
Ed Bartosh
edbc32fa60 DRA: implement scoring for extended resources
Updated extended resource allocation scorer to calculate
allocatable and requested values for DRA-backed resources.
2025-11-06 10:40:52 +02:00
Kubernetes Prow Robot
7537d52c2e Merge pull request #134882 from yliaog/initcon
Fix non-sidecar init container device requests
2025-11-05 21:57:04 -08:00
Kubernetes Prow Robot
f025bcace9 Merge pull request #135068 from pohly/dra-device-taints-1.35-full
DRA device taint eviction: several improvements
2025-11-05 18:52:58 -08:00
yliao
6676982316 fixed non-sidecar init container device requests and mappings 2025-11-05 22:48:50 +00:00
Kubernetes Prow Robot
cf37f0bf49 Merge pull request #135037 from yliaog/extendedresourcecache
pick one device class deterministically for extended resource
2025-11-05 14:16:58 -08:00
Kubernetes Prow Robot
738475f9e2 Merge pull request #134991 from yliaog/class_events
added device class add/update events to noderesources plugin when DRAExtendedResource feature is enabled
2025-11-05 14:16:51 -08:00
Kubernetes Prow Robot
799572b8db Merge pull request #134711 from mortent/SimpleScoringForPrioritizedList
DRA: Add scoring for Prioritized List feature
2025-11-05 12:36:51 -08:00
Patrick Ohly
eaee6b6bce DRA device taints: add separate feature gate for rules
Support for DeviceTaintRules depends on a significant amount of
additional code:
- ResourceSlice tracker is a NOP without it.
- Additional informers and corresponding permissions in scheduler and controller.
- Controller code for handling status.

Not all users necessarily need DeviceTaintRules, so adding a second feature
gate for that code makes it possible to limit the blast radius of bugs in that
code without having to turn off device taints and tolerations entirely.
2025-11-05 20:03:17 +01:00
Kubernetes Prow Robot
3395c5358c Merge pull request #135012 from gnufied/volume-limits-redux-cas
Do not schedule pods to a node without CSI driver
2025-11-05 09:42:58 -08:00
Morten Torkildsen
fbfeb33231 DRA: Add scoring for Prioritized List feature 2025-11-05 17:18:38 +00:00
yliao
949be1d132 fixed comments due to switch from class name to class for GetDeviceClass 2025-11-05 15:08:38 +00:00
Hemant Kumar
c77a39c06f Address review comments and fix failing tests 2025-11-05 09:44:50 -05:00
Ayato Tokubi
902c2e0c15 Fix lint errors in dynamicresources_test.go
Signed-off-by: Ayato Tokubi <atokubi@redhat.com>
2025-11-05 10:44:50 +00:00
Ayato Tokubi
c5b1493925 Add test case for claim creation failure in DRAExtendedResources
Extend the `setup` function to support API reactors, allowing custom reactions in tests.

Signed-off-by: Ayato Tokubi <atokubi@redhat.com>
2025-11-05 09:55:28 +00:00
Ayato Tokubi
ea7561b243 Implement scheduler_resourceclaim_creates_total metrics for DRAExtendedResources 2025-11-05 09:53:33 +00:00
Hemant Kumar
336a3e9275 Update pkg/scheduler/framework/plugins/nodevolumelimits/csi_manager.go
Co-authored-by: Maciej Skoczeń <87243939+macsko@users.noreply.github.com>
2025-11-04 13:41:32 -05:00
yliao
c67937dd35 switched from storing name to storing a pointer to the device class. 2025-11-04 17:51:12 +00:00
fj-naji
c438f8a983 scheduler: Add BindingTimeout args to DynamicResources plugin
Add a new `bindingTimeout` field to DynamicResources plugin args and wire it
into PreBind.

Changes:
- API: add `bindingTimeout` to DynamicResourcesArgs (staging + internal types).
- Defaults: default to 600 seconds when BOTH DRADeviceBindingConditions and
  DRAResourceClaimDeviceStatus are enabled.
- Validation: require >= 1s; forbid when either feature gate is disabled.
- Plugin: plumbs args into `pl.bindingTimeout` and uses it in
  `wait.PollUntilContextTimeout` for binding-condition wait logic.
- Plugin: remove legacy `BindingTimeoutDefaultSeconds`.

Tests:
- Add/adjust unit tests for validation and PreBind timeout path.
- Ensure <1s and negative values are rejected; forbids when gates disabled.
2025-11-04 17:15:19 +00:00
yliao
2e479e00f4 refactored the hint function, added test cases 2025-11-04 16:31:57 +00:00
Hemant Kumar
002774c315 Address review comments 2025-11-04 11:16:43 -05:00
Ania Borowiec
a92b987b3d comments 2025-11-04 12:55:16 +00:00
Ania Borowiec
9640da5452 Verify if pod has ongoing async preemption before evicting pods 2025-11-04 11:57:34 +00:00
yliao
14f17a3809 addressed review feedback 2025-11-03 22:53:27 +00:00
Hemant Kumar
713b7231d8 Merely check for presence of CSIdriver object 2025-11-03 17:46:19 -05:00
yliao
b609d4713c added integration test case 2025-11-03 21:27:41 +00:00
yliao
7aa849160a added queue hint function 2025-11-03 21:27:41 +00:00
yliao
3b905ae4b5 added device class add/update events to noderesources plugin when DRAExtendedResource feature is enabled 2025-11-03 21:27:41 +00:00
Hemant Kumar
fe3722dfa9 Address review comments
Change type name and stuff
2025-11-03 16:27:06 -05:00
Hemant Kumar
b9118183cf Fix the boilet plate 2025-11-03 16:26:47 -05:00
yliao
b83a6a83f0 pick the device class created latest, or with name alphabetically sorted earlier 2025-11-03 19:28:18 +00:00
Kubernetes Prow Robot
462c869354 Merge pull request #134326 from sairameshv/global_cache_dra
Add global cache to map between the deviceclass and the extended resource
2025-11-03 10:40:06 -08:00
yliao
3eab698884 fixed unit test and integration test failures
Fix minor nits

Signed-off-by: Sai Ramesh Vanka <svanka@redhat.com>
2025-11-03 20:07:01 +05:30
Kubernetes Prow Robot
4e5220939e Merge pull request #134927 from macsko/dont_delete_pods_with_deletiontimestamp
Don't preempt pods with DeletionTimestamp set
2025-11-03 06:02:14 -08:00
Patrick Ohly
12a0c8ce17 DRA extended resource: chain event handlers
The cache and scheduler event handlers cannot be registered separately in the
informer, that leads to a race (scheduler might schedule based on event before
cache is updated). Chaining event handlers (cache first, then scheduler) avoids
this.

This also ensures that the cache is up-to-date before the scheduler
starts (HasSynced of the handler registration for the cache is checked).

Other changes:
- renamed package to avoid clash with other "cache" packages
- clarified nil handling
- feature gate check before instantiating the cache
- per-test logging
- utilruntime.HandleErrorWithLogger
- simpler cache.DeletedFinalStateUnknown

Signed-off-by: Sai Ramesh Vanka <svanka@redhat.com>
2025-11-03 12:31:17 +05:30
Sai Ramesh Vanka
d8c66ffb63 Add a global cache to support DRA's extended resource to the device
class mapping

- Add a new interface "DeviceClassResolver" in the scheduler framework
- Add a global cache of mapping between the extended resource and the
  device class
- Cache can be leveraged by the k8s api-server, controller-manager along with the scheduler
- This change helps in delegating the requests to the dynamicresource
  plugin based on the mapping during the node update events and thus
avoiding an extra scheduling cycle

Signed-off-by: Sai Ramesh Vanka <svanka@redhat.com>
2025-11-03 12:31:16 +05:30
Hemant Kumar
a1ce4bb468 Check for CSIDriver object before stopping pod scheduling 2025-10-31 16:06:37 -04:00
Hemant Kumar
2f0a84af1a Add csidriver lister to CSI scheduler plugin 2025-10-31 15:36:25 -04:00
Hemant Kumar
85d7626d2d Do not schedule pods if CSI driver is not ready 2025-10-31 15:09:03 -04:00
Hemant Kumar
c71e45c735 Implement a csimanager for managing storage related assets 2025-10-31 11:06:58 -04:00
Hemant Kumar
7bbec73192 Add a interface for sharing CSINode objects between scheduler and CAS 2025-10-30 13:53:10 -04:00
Kubernetes Prow Robot
9e284866c3 Merge pull request #134740 from hoskeri/untolerated-taint-generic
Do not log untolerated taint in pod status updates.
2025-10-30 02:22:03 -07:00
Kubernetes Prow Robot
808d320de1 Merge pull request #134956 from yliaog/blockowner
removed BlockOwnerDeletion
2025-10-30 01:26:11 -07:00
yliao
4f647b3f3d removed BlockOwnerDeletion 2025-10-29 22:41:10 +00:00
Maciej Skoczeń
a42581c7d3 Don't preempt pods with DeletionTimestamp set 2025-10-29 09:05:24 +00:00
Abhijit Hoskeri
08b1b1d5a4 Do not log untolerated taint in pod status updates.
The taint toleration plugin records taint keys and values
from non-matching nodes. Taint keys and values may be
sensitive information in some environments.

Use a generic message, and show the info in logs instead.
2025-10-28 10:56:27 -07:00
Kubernetes Prow Robot
d5efbf2ebf Merge pull request #134452 from pohly/dra-ga-feature-gate
DRA: lock to default-on
2025-10-28 07:49:36 -07:00
Kubernetes Prow Robot
f0ed028e75 Merge pull request #133784 from bart0sh/PR197-DRA-process-devices-when-allocatable-is-0
Treat extended resources as inactive when allocatable is 0
2025-10-28 03:29:36 -07:00
Ed Bartosh
1cb45e2a27 DRA: fix scheduling of pods with extended resources
Previously, the scheduler assumed an extended resource was maintained
by a device plugin if its name was present in the node's Allocatable
map, even if its value was zero. This blocked scheduling when a device
plugin was disconnected or uninstalled, because Kubelet still reported
the resource with Allocatable=0.

This change adds a check for the actual allocatable value in addition
to a key presence check, allowing nodes with uninstalled device
plugins to be considered for scheduling.
2025-10-27 16:24:29 +02:00
Patrick Ohly
8b6f98b06e DRA: lock to default-on
The core functionality was enabled by default in 1.34 without any issues that
would have suggested turning it off, so now we can lock it to on-by-default.

Tests which cover disabling the feature must use version emulation.
2025-10-24 20:04:20 +02:00
Nour
dd8d0e65d4 Dedicated package for scheduler interaction with DRA structured types 2025-10-07 23:14:03 +03:00