48 Commits

Author SHA1 Message Date
carlory
aab7a079fa make each scheduler test independent
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-03-13 14:39:50 +08:00
dom4ha
4deb4f2b5f Trigger rescheduling on delete event also when unscheduled pod is removed 2025-03-10 15:03:50 +00:00
Patrick Ohly
33ea278c51 DRA: use v1beta1 API
No code is left which depends on the v1alpha3, except of course the code
implementing that version.
2024-11-06 13:03:19 +01:00
Kensei Nakada
83f9e4b6df cleanup: remove event list 2024-10-18 11:10:10 +10:00
Patrick Ohly
f84eb5ecf8 DRA: remove "classic DRA"
This removes the DRAControlPlaneController feature gate, the fields controlled
by it (claim.spec.controller, claim.status.deallocationRequested,
claim.status.allocation.controller, class.spec.suitableNodes), the
PodSchedulingContext type, and all code related to the feature.

The feature gets removed because there is no path towards beta and GA and DRA
with "structured parameters" should be able to replace it.
2024-10-16 23:09:50 +02:00
googs1025
69831b0043 chore(scheduler): refactor import package ordering 2024-09-18 20:31:03 +08:00
Richa Banker
6944af22d1 Initialize scheduler metrics after metrics options are applied 2024-09-13 12:52:32 -07:00
Kensei Nakada
24a14aa810 fix: run a test for requeueing with PreFilterResult correctly 2024-09-07 23:52:45 +09:00
Kensei Nakada
4ee1394b71 feat: disable preCheck when QHint is enabled 2024-09-04 17:43:00 +09:00
Kensei Nakada
8519d3399f chore: move the scheduler internal components out of internal dir 2024-08-25 13:10:29 +09:00
Patrick Ohly
e85d3babf0 DRA scheduler: fix re-scheduling after ResourceSlice changes
Making unschedulable pods schedulable again after ResourceSlice cluster events
was accidentally left out when adding structured parameters to Kubernetes 1.30.

All E2E tests were defined so that a driver starts first. A new test with a
different order (create pod first, wait for unschedulable, start driver)
triggered the bug and now passes.
2024-08-22 10:09:32 +02:00
Patrick Ohly
599fe605f9 DRA scheduler: adapt to v1alpha3 API
The structured parameter allocation logic was written from scratch in
staging/src/k8s.io/dynamic-resource-allocation/structured where it might be
useful for out-of-tree components.

Besides the new features (amount, admin access) and API it now supports
backtracking when the initial device selection doesn't lead to a complete
allocation of all claims.

Co-authored-by: Ed Bartosh <eduard.bartosh@intel.com>
Co-authored-by: John Belamaric <jbelamaric@google.com>
2024-07-22 18:09:34 +02:00
Patrick Ohly
b51d68bb87 DRA: bump API v1alpha2 -> v1alpha3
This is in preparation for revamping the resource.k8s.io completely. Because
there will be no support for transitioning from v1alpha2 to v1alpha3, the
roundtrip test data for that API in 1.29 and 1.30 gets removed.

Repeating the version in the import name of the API packages is not really
required. It was done for a while to support simpler grepping for usage of
alpha APIs, but there are better ways for that now. So during this transition,
"resourceapi" gets used instead of "resourcev1alpha3" and the version gets
dropped from informer and lister imports. The advantage is that the next bump
to v1beta1 will affect fewer source code lines.

Only source code where the version really matters (like API registration)
retains the versioned import.
2024-07-21 17:28:13 +02:00
Kubernetes Prow Robot
bae59799e9 Merge pull request #126050 from sanposhiho/refactor-move
cleanup: refactor the way extracting Node smaller events
2024-07-12 08:13:12 -07:00
Kensei Nakada
9772ff2848 cleanup: move NodeSchedulingPropertiesChange 2024-07-12 19:21:48 +09:00
googs1025
d4627f16a5 chore: call close framework when finishing
Signed-off-by: googs1025 <googs1025@gmail.com>
2024-07-12 18:11:04 +08:00
Patrick Ohly
9a6f3b9388 scheduler: central ResourceClaim assume cache
This enables connecting the event handler for ResourceClaim to the assume
cache, which addresses a theoretic race condition.

It may also be useful for implementing the autoscaler support, because now
the autoscaler can modify the content of the cache.
2024-06-25 14:00:25 +02:00
amewayne
71c3593f85 support nodeAnnotationsChanged event to trigger rescheduling 2024-01-10 22:38:54 +08:00
kerthcet
e5b86c1034 Fix node update event will miss some potential changes
Signed-off-by: kerthcet <kerthcet@gmail.com>
2023-11-27 15:33:47 +08:00
kidddddddddddddddddddddd
9c7166ff63 wait for eventhandlers to sync before run scheduler 2023-06-27 23:19:34 +08:00
Mengjiao Liu
074900e81b scheduler: update the scheduler interface and cache methods to use contextual logging 2023-05-29 13:26:32 +08:00
Monis Khan
f01295067f Revert "Enable paralellism in scheduler unit tests"
This reverts commit f37ab167f8.

Signed-off-by: Monis Khan <mok@microsoft.com>
2022-09-23 12:00:14 -04:00
Victor Morales
f37ab167f8 Enable paralellism in scheduler unit tests
Unit tests run in parallel at the package level. This change allows the
execution of sig/scheduling unit tests in parallel.

Signed-off-by: Victor Morales <v.morales@samsung.com>
2022-09-14 14:20:56 -07:00
Kubernetes Prow Robot
24a71990e0 Merge pull request #108445 from pohly/storage-capacity-ga
storage capacity GA
2022-03-23 08:06:21 -07:00
Paco Xu
acd696266e mark PodOverhead to GA in v1.24; remove in v1.26 2022-03-17 09:30:14 +08:00
Patrick Ohly
f84f4fa291 storage capacity: use V1 API 2022-03-14 20:05:45 +01:00
kerthcet
eafbaad9f7 refactor: rename SchedulerCache to Cache in Scheduler
Signed-off-by: kerthcet <kerthcet@gmail.com>
2022-02-24 09:47:21 +08:00
Kante
62eb70c1b3 reuse InformerFactory in scheduler tests (#107835)
* reuse informer in scheduler tests

Signed-off-by: kerthcet <kerthcet@gmail.com>

* reduce construct two informers

Signed-off-by: kerthcet <kerthcet@gmail.com>

* instantiate formerfacotry error

Signed-off-by: kerthcet <kerthcet@gmail.com>
2022-02-09 16:53:58 -08:00
Kubernetes Prow Robot
0dcd6eaa0d Merge pull request #103934 from boenn/tainttoleration
De-duplicate predicate (known as filter now) logic shared in kubelet and scheduler
2022-02-09 16:53:46 -08:00
Wei Huang
939e98135c sched: fix goroutine leak in unit tests 2022-01-22 22:53:11 -08:00
BinacsLee
1027b8de40 scheduler: fix race condition during cache refresh 2021-12-10 20:46:12 +08:00
boenn
cec2aae1e5 rebase master 2021-11-25 11:21:12 +08:00
00255991
06a9bfbb21 Add unit tests for scheduler's dynamic event handlers registration 2021-09-14 22:51:52 +08:00
Kubernetes Prow Robot
ae40c62c49 Merge pull request #100286 from tanjing2020/skip_updates_assumed_pods
Scheduler: skip updates of assumed pods
2021-04-08 20:29:29 -07:00
tanjing2020
d4465b995e Scheduler: skip updates of assumed pods 2021-03-24 10:01:22 +08:00
Wei Huang
6384f397b4 sched: support PreEnqueueChecks prior to moving Pods 2021-03-11 12:31:50 -08:00
Abdullah Gharaibeh
c7fef196b6 Implements pod affinity NamespaceSelector feature 2021-03-04 07:30:24 -05:00
Aldo Culquicondor
da6fcfaf74 Skip Pod Conditions from scheduling queue updates
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-05-19 10:59:10 -04:00
Kubernetes Prow Robot
52ae8b1ebb Merge pull request #91099 from snowplayfire/skip_unnecessary_scheduling
skip unnecessary scheduling attempt when pod has its Finalizers updated
2020-05-15 23:02:22 -07:00
Wei Huang
1b30105dac Fix scheduler cache inconsistency upon Pods with same name but different UIDs
Co-authored-by: Wei Huang <wei.huang1@ibm.com>
Co-authored-by: tianxia52 <871883758@qq.com>
2020-05-15 11:41:54 -07:00
jingxueli
b95191fe10 add test for finalizers 2020-05-15 18:57:09 +08:00
Fabio Kung
d341a5b9d3 kube-scheduler: compatibility with ServerSideApply
avoid moving Pods that have been assumed back to the scheduling queue in
case they have annotations modified with ServerSideApply, which causes
Pod.ObjectMeta.ManagedFields to be modified automatically
2020-04-22 12:02:40 -07:00
Aldo Culquicondor
f53d7e55df Move Snapshot from nodeinfo/snapshot to internal/cache
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-01-17 13:29:41 -05:00
Wei Huang
82afa2bbaf Fix up the sub-test style 2019-12-16 11:28:12 -08:00
Ahmad Diaa
7156d4532e remove factory.Config struct and NewFromConfig 2019-11-11 19:27:53 +01:00
Ahmad Diaa
4448a1cea9 move factory package to scheduler 2019-10-12 23:03:07 +02:00
Pingan2017
e94d7b3802 clean up redundant conditiontype OutOfDisk 2019-07-03 14:34:52 +08:00
Mayank Kumar
e0a7d96632 Move informer event handlers to Scheduler 2019-01-29 17:53:20 -08:00