Commit graph

181 commits

Author SHA1 Message Date
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
Kensei Nakada
d4d91d4ace fix: use set methods 2024-11-07 14:09:35 +09:00
Kensei Nakada
a95b8b5085 fix: use Activate always 2024-11-07 14:09:35 +09:00
Kensei Nakada
677792663f fix: register Pod/Delete event at the preemption plugin 2024-11-07 14:09:35 +09:00
Kensei Nakada
fe3119fa69 make sure DefaultPreemption implements PreEnqueuePlugin 2024-11-07 14:09:35 +09:00
Kensei Nakada
69a8d0ec0b feature(KEP-4832): asynchronous preemption 2024-11-07 14:09:34 +09:00
NoicFank
68f7a7c682 bugfix(scheduler): preemption picks wrong victim node with higher priority pod on it.
Introducing pdb to preemption had disrupted the orderliness of pods in the victims,
which would leads picking wrong victim node with higher priority pod on it.
2024-10-29 19:50:55 +08:00
googs1025
69831b0043 chore(scheduler): refactor import package ordering 2024-09-18 20:31:03 +08:00
Kensei Nakada
fe3ab649d0 feat: remove node general update event from EventsToRegister when QHint is enabled 2024-09-14 16:15:40 +09:00
Richa Banker
6944af22d1 Initialize scheduler metrics after metrics options are applied 2024-09-13 12:52:32 -07:00
Kubernetes Prow Robot
e90364f45d
Merge pull request #126465 from googs1025/podEligibleToPreemptOthers_refactor
feat: add ctx param for PodEligibleToPreemptOthers
2024-09-02 12:02:56 +01:00
Kensei Nakada
8519d3399f chore: move the scheduler internal components out of internal dir 2024-08-25 13:10:29 +09:00