Commit graph

192 commits

Author SHA1 Message Date
Maciej Skoczeń
54ca619d4b Merge GangScheduling and WorkloadAwarePreemption feature gates into GenericWorkload 2026-06-15 11:42:10 +00:00
Maciej Wyrzuc
29ddc2907b Wrap errors from pod group preemption 2026-05-26 12:54:46 +00:00
Antoni Basista
8b8aa9c52b Add support for NNN in podgrouppreemption 2026-05-25 08:54:22 +00:00
dom4ha
8a52fb2ea9 Migrate references to v1alpha3 in tests, controllers, and remaining files 2026-05-22 12:50:19 +00:00
dom4ha
43ebd00b66 Migrate internal references from v1alpha2 to v1alpha3 in scheduler and admission plugins 2026-05-22 12:50:19 +00:00
Matt Matejczyk
259b504c3b scheduler: match preemptor eligibility behavior in pod group preemption 2026-05-15 11:34:18 +00:00
Jarosław Dzikowski
b7edf53ab3 Try to schedule as many pods as possible during workload preemption algorithm 2026-05-07 11:52:33 +00:00
iomarsayed
7a54834917 split pod resource types to help plugins register to only cluster events which they require 2026-04-17 08:29:24 +00:00
Antoni Zawodny
ccaaf9d3a5 Marry WAP logic with the new API fields 2026-03-24 09:36:00 +01:00
Maciej Wyrzuc
1f15743e49 Add pod group preemption 2026-03-23 16:22:32 +00:00
Omar Sayed
e1b18e34ff snapshot pod group state before scheduling cycle and embed pod group manager into cache 2026-03-13 21:44:17 +00:00
Antoni Zawodny
fa29c9db6a
Revert "Extend PostFilterResult with a list of victim Pods" 2026-03-12 10:03:35 +01:00
Antoni Zawodny
3f094dc228
Create Workload API v1alpha2 (#136976)
* Drop WorkloadRef field and introduce SchedulingGroup field in Pod API

* Introduce v1alpha2 Workload and PodGroup APIs, drop v1alpha1 Workload API

Co-authored-by: yongruilin <yongrlin@outlook.com>

* Run hack/update-codegen.sh

* Adjust kube-scheduler code and integration tests to v1alpha2 API

* Drop v1alpha1 scheduling API group and run make update

---------

Co-authored-by: yongruilin <yongrlin@outlook.com>
2026-03-10 07:59:10 +05:30
Bartosz
e5461b7701
Prepare pod group scheduling cycle for placement simulation 2026-03-03 18:07:13 +00:00
Maciej Wyrzuc
4a326b0196 Preempt pods in prebind phase without delete calls.
This change allows the preemption to preempt a pod that is not yet
bound, but is already in prebind phase) without issuing a delete call to the
apiserver.

Pods are added to a special map of pods currently in prebind phaseand
preemption can cancel the context that is used for given pod prebind phase ,
allowing it to gracefully handle error in the same manner as errors
coming out from prebind plugins. This results in pods being pushed to
backoff queue, allowing them to be rescheduled in upcoming scheduling
cycles.
2026-02-18 09:00:23 +00:00
Antoni Zawodny
25d93e1f8e Extend PostFilterResult with a list of victim Pods 2026-02-17 16:50:20 +01:00
Roman Baron
74b7ff3c63 scheduler: Remove ttl parameter from cache.New signature 2026-01-13 17:04:06 +02:00
Ravi Sastry Kadali
9dc5683c56 scheduler: Fix memory leak in scheduler cache
The `removeSlice` function was leaving behind references to the
removed element, preventing it from being garbage-collected.
This commit ensures that removed entries are fully cleared,
eliminating the memory leak.

Co-authored-by: ravisastryk <ravisastryk@gmail.com>
Signed-off-by: Sujal Shah <sujalshah28092004@gmail.com>
2025-11-20 02:18:38 +05:30
Maciej Skoczeń
3dfcda9afd Fix minor inconsistencies in scheduler 2025-09-10 11:40:10 +00:00
Ania Borowiec
fadb40199f
Move interfaces: Handle and Plugin and related types from kubernetes/kubernetes to staging repo kube-scheduler 2025-09-02 09:42:53 +00:00
Maciej Skoczeń
17d733e243 KEP-5229: Send API calls through dispatcher and cache 2025-07-25 15:35:36 +00:00
Ania Borowiec
aecd37e6fb
Moving Scheduler interfaces to staging: Move PodInfo and NodeInfo interfaces (together with related types) to staging repo, leaving internal implementation in kubernetes/kubernetes/pkg/scheduler 2025-07-24 12:10:58 +00:00
Ania Borowiec
ee8c265d35
Move Code and Status from pkg/scheduler/framework to k8s.io/kube-scheduler/framework 2025-06-30 10:06:22 +00:00
Ania Borowiec
00d3750503
Move ClusterEvent type to staging repo, leaving some functions (that contain logic internal to scheduler) in kubernetes/kubernetes (#132190)
* Move ClusterEvent type to staging repo, leaving some functions (that contain logic internal to scheduler) in kubernetes/kubernetes

apply review comment and fix linter warning

* update-vendor.sh

* update doc comments

* run update-vendor.sh
2025-06-26 08:06:29 -07:00
Kubernetes Prow Robot
e0859f91b7
Merge pull request #131887 from ania-borowiec/extract_cyclestate_interface
Moving Scheduler interfaces to staging: split CycleState into interface and implementation, move interface to staging repo
2025-05-30 04:00:18 -07:00
Ania Borowiec
d75af825fb
Extract interface CycleState and move is to staging repo. CycleState implementation remains in k/k/pkg/scheduler/framework 2025-05-29 16:18:36 +00:00
Kubernetes Prow Robot
0afe2b839d
Merge pull request #129983 from nickbp/master
feature(scheduler): Customizable pod selection and ordering in DefaultPreemption plugin
2025-05-20 05:09:15 -07:00
Nicholas Parker
7bccb1acb5
Update pkg/scheduler/framework/plugins/defaultpreemption/default_preemption.go
Co-authored-by: Dominik Marciński <gmidon@gmail.com>
2025-05-16 13:12:13 +12:00
Nicholas Parker
28602c66fc Update pkg/scheduler/framework/plugins/defaultpreemption/default_preemption_test.go
Co-authored-by: Maciej Skoczeń <87243939+macsko@users.noreply.github.com>
2025-05-13 06:56:27 +12:00
Nick Parker
52e7aa37da gofmt 2025-05-13 06:56:27 +12:00
Nick Parker
a507e64fe4 Have separate tests for custom selection vs ordering, add comments around system pod eligibility 2025-05-13 06:56:27 +12:00
Nick Parker
283c5e6b61 Have IsEligiblePod be supplemental to priority check, update tests 2025-05-13 06:56:27 +12:00
Nick Parker
3ed73e058a Clean up the affinity explanation, fix for new lint rule 2025-05-13 06:56:27 +12:00
Nick Parker
d4bc527a7b Update comments: affinity info, default behavior, priority->importance 2025-05-13 06:56:27 +12:00
Nicholas Parker
95ebc2c10e Apply suggestions from code review
Co-authored-by: Dominik Marciński <gmidon@gmail.com>
2025-05-13 06:56:27 +12:00
Nick Parker
7f57c6e52d Update factory to use generics, keep single New function 2025-05-13 06:56:27 +12:00
Nick Parker
137da6a488 Remove line about equal priority, fix typo 2025-05-13 06:56:27 +12:00
Nicholas Parker
b8ac171437 Apply suggestions from code review
Co-authored-by: Dominik Marciński <gmidon@gmail.com>
2025-05-13 06:56:27 +12:00
Nick Parker
224e6a3a35 Rename EligiblePod* to IsEligiblePod* 2025-05-13 06:56:27 +12:00
Nick Parker
4bf6841495 Update the customizations to operate on individual pods, for more flexibility later 2025-05-13 06:56:27 +12:00
Nick Parker
c34f8db559 Remove unnecessary context and typecheck, switch to cmp.Diff 2025-05-13 06:56:27 +12:00
Nick Parker
c6f2d3879b Fix gofmt in default_preemption_test.go 2025-05-13 06:56:26 +12:00
Nick Parker
78b059c064 rename OrderedPods -> OrderPods 2025-05-13 06:56:26 +12:00
Nick Parker
2616202ac9 Implement tests with example customizations, add direct constructor 2025-05-13 06:56:26 +12:00
Nick Parker
760daaf110 feature(scheduler): Custom pod selection/ordering in DefaultPreemption
The current behavior is to select only based on pod priority, where any
pod with higher priority can preempt any pod with lower priority.

In our case, we have multiple priority classes but where only a subset
of those are considered preemptible. Here's roughly how this looks:

- High priority: higher in the scheduling queue, not preemptible
- Low priority: lower in the scheduling queue, not preemptible
- Preemptible priority: lowest in the scheduling queue, preemptible

This PR allows the preemption selection to be configured against the
`DefaultPreemption` plugin, rather than needing to reimplement the
plugin itself. The structure used here mimics [what's currently being
done for the `Evaluator`](https://github.com/kubernetes/kubernetes/blob/release-1.32/pkg/scheduler/framework/preemption/preemption.go#L161-L165),
where a `PreemptPod` callback may be overridden to customize what
happens when performing a preemption.

This PR also updates the plugin's tests to call the updated `New()`
function rather than constructing `DefaultPreemption` directly, so
that `New()` is now being exercised in tests.
2025-05-13 06:56:26 +12:00
Kensei Nakada
47d296d62d feat: introduce pInfo.GatingPlugin to filter out events more generally 2025-05-07 13:54:47 +02:00
Kubernetes Prow Robot
8a6b916765
Merge pull request #130720 from saintube/scheduler-expose-nodeinfo-in-prefilter
Expose NodeInfo to PreFilter plugins
2025-04-23 13:31:29 -07:00
saintube
8dc6806d26 Expose NodeInfo to PreFilter plugins and Framework
Co-authored-by: Zhan Sheng <49895476+AxeZhan@users.noreply.github.com>
Co-authored-by: shenxin <rougang.hrg@alibaba-inc.com>
Signed-off-by: saintube <saintube@foxmail.com>
2025-03-21 14:55:25 +08:00
carlory
aab7a079fa make each scheduler test independent
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-03-13 14:39:50 +08:00
Jordan Liggitt
8090db5dcf
Switch to private instances of rand for seeding for tests 2025-02-26 11:27:10 +01:00