Commit graph

258 commits

Author SHA1 Message Date
Gabriela Filipek
3f7c813ec8
Update pkg/scheduler/framework/runtime/framework.go
Co-authored-by: Maciej Skoczeń <87243939+macsko@users.noreply.github.com>
2026-07-10 12:51:43 +02:00
gfilipek
f5994eaff5 scheduler: update test metrics coverage using TestPlugin directly 2026-07-10 09:55:02 +00:00
gfilipek
9f6514c99f scheduler: add PodGroupPostFilter metrics and unit tests 2026-07-10 06:09:51 +00:00
kubernetes-prow[bot]
310d9b8201
Merge pull request #139674 from GFilipek/feature/placement-post-filter
Feature: Add PodGroupPostFilter extension point
2026-07-09 18:56:33 +00:00
gfilipek
28027817bb scheduler: key NominatingInfos by types.NamespacedName in PodGroupPostFilterResult 2026-07-09 15:28:46 +00:00
gfilipek
cff5332d57 framework: introduce and configure PodGroupPostFilter extension point iteration 2026-07-09 15:28:46 +00:00
Antoni Zawodny
0b06f1b862 Run PlacementFeasible before any Pod is attempted 2026-07-09 13:06:40 +02:00
Antoni Basista
a84388789f Decouple WAP logic from scheduler struct 2026-07-03 14:07:11 +00:00
Maciej Skoczeń
0e2ac7a40f Cache and snapshot PodGroup API objects in kube-scheduler 2026-07-02 10:57:06 +00:00
kubernetes-prow[bot]
8c64324b69
Merge pull request #139880 from brejman/placement-feasible-status-update
Update PlacementFeasible statuses according to KEP
2026-06-22 10:23:44 +00:00
brejman
d62640f75a Update PlacementFeasible statuses according to KEP
Unschedulable -> Wait
UnschedulableAndUnresolvable -> Unschedulable

In the future, we can return UnschedulableAndUnresolvable if there's not
enough pods in the podgroup in total.
2026-06-22 09:12:56 +00:00
weizhoublue
4e64e19fb7
scheduler: log error instead of failing when GangScheduling plugin is missing
Signed-off-by: weizhoublue <weizhou.lan@daocloud.io>
2026-06-18 16:26:58 +08:00
Maciej Skoczeń
54ca619d4b Merge GangScheduling and WorkloadAwarePreemption feature gates into GenericWorkload 2026-06-15 11:42:10 +00:00
Bartosz
499e68fd23
Return error PlacementFeasible is not implemented in GangScheduling 2026-06-02 10:30:49 +00:00
Kubernetes Prow Robot
ae84ac1a16
Merge pull request #138274 from wtravO/wtravo/placement-cycle-state
Add PlacementCycleState to WAS scheduler framework
2026-05-28 16:28:48 +05:30
wtravO
b968273f03 Pass PlacementCycleState to PlacementFeasible plugins 2026-05-27 10:44:44 -04:00
wtravO
bb6664b1e2 Address review feedback 2026-05-27 10:25:23 -04:00
wtravO
101af7309c Keep PlacementCycleState out of PodGroupAssignments 2026-05-27 10:25:23 -04:00
wtravO
bd97e3f190 expose PodGroupCycleState via PlacementCycleState 2026-05-27 10:25:23 -04:00
Maciej Skoczeń
8eb66b73ef Add support for PodGroups in scheduling queue 2026-05-27 13:06:13 +00:00
Bartosz
1e1bad1dde
Add PlacementFeasible plugin to support early gang termination 2026-05-25 10:36:03 +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
Kubernetes Prow Robot
29d76f2ed8
Merge pull request #138757 from jdzikowski/mincount-preemption
Do not allow to decrease the number of scheduled preemptor pods during the preemption reprieve process.
2026-05-07 20:09:18 +05:30
Jarosław Dzikowski
b7edf53ab3 Try to schedule as many pods as possible during workload preemption algorithm 2026-05-07 11:52:33 +00:00
Maciej Skoczeń
0d9aca8306 Handle opportunistic batching correctly for PodGroup scheduling cycle 2026-05-04 15:28:10 +00:00
zak905
04286814e7 clean up: remove loop variable capture 2026-04-28 23:53:27 +02:00
utam0k
822787a2d1
scheduler: bypass opportunistic OpportunisticBatching for nominated pods
Signed-off-by: utam0k <k0ma@utam0k.jp>
2026-04-05 16:48:28 +09:00
Maciej Wyrzuc
1f15743e49 Add pod group preemption 2026-03-23 16:22:32 +00:00
Maciej Wyrzuc
1382c96217 Allow cycle state to skip all post filter plugins 2026-03-23 12:30:23 +00:00
Nour
aa5e5ea9d6
scheduler: use contextual logging for event emission
Signed-off-by: Nour <nurmn3m@gmail.com>
2026-03-19 14:33:09 +02:00
Kubernetes Prow Robot
c332baec33
Merge pull request #136155 from bhope/metrics-beta-scheduler
Promote scheduler metrics to beta
2026-03-17 04:47:37 +05:30
Prathamesh Bhope
d66ae77959 Promote scheduler metrics to beta 2026-03-13 16:06:42 -07: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
Kubernetes Prow Robot
7f3a5ab96f
Merge pull request #136579 from romanbaron/reuse-scheduling-signature
Reuse pod scheduling signature for opportunistic batching
2026-03-13 20:15:39 +05:30
Roman Baron
c0e973dc70 scheduler: Replaced context.Context and testing.T parameters with ktesting.TContext in scheduling_queue_test.go 2026-03-12 17:31:11 +02:00
Bartosz
43c5d2a419
Add PlacementGeneratePlugin interface and runner 2026-03-12 09:33:05 +00:00
Roman Baron
de1385fe1b scheduler: Added ObserveFrameworkDurationAsync to metrics recorder 2026-03-12 10:31:38 +02:00
Roman Baron
7b00255135 scheduler: Removed plugin stats from pod signing process 2026-03-12 10:31:04 +02:00
Roman Baron
3a6c169034 scheduler: Reuse scheduling signature for opportunistic batching 2026-03-12 10:30:32 +02:00
Bartosz
f50ae7284a
Remove feature gate check for placement score plugin validation 2026-03-10 09:42:07 +00:00
Bartosz
335f043756
Add Min/MaxScore to replace Min/MaxNodeScore 2026-03-10 09:42:05 +00:00
Bartosz
db3c8f3a4b
Add PlacementScorePlugin interface and runner 2026-03-10 09:42:04 +00: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
Kubernetes Prow Robot
8bd1505fc0
Merge pull request #137108 from pohly/logtools-update
golangci-lint: bump to logtools v0.10.1
2026-03-05 10:14:16 +05:30
Kubernetes Prow Robot
8275484dcf
Merge pull request #137297 from atombrella/feature/pkg_forvar_modernize
Remove redundant variable re-assignment in for-loops under pkg
2026-03-05 00:28:20 +05:30
Patrick Ohly
b895ce734f golangci-lint: bump to logtools v0.10.1
This fixes a bug that caused log calls involving `klog.Logger` to not be
checked.

As a result we have to fix some code that is now considered faulty:

    ERROR: pkg/controller/serviceaccount/tokens_controller.go:382:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (e *TokensController) generateTokenIfNeeded(ctx context.Context, logger klog.Logger, serviceAccount *v1.ServiceAccount, cachedSecret *v1.Secret) ( /* retry */ bool, error) {
    ERROR: ^
    ERROR: pkg/controller/storageversionmigrator/storageversionmigrator.go:299:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (svmc *SVMController) runMigration(ctx context.Context, logger klog.Logger, gvr schema.GroupVersionResource, resourceMonitor *garbagecollector.Monitor, toBeProcessedSVM *svmv1beta1.StorageVersionMigration, listResourceVersion string) (err error, failed bool) {
    ERROR: ^
    ERROR: pkg/proxy/node.go:121:3: logging function "Error" should not use format specifier "%q" (logcheck)
    ERROR: 		klog.FromContext(ctx).Error(nil, "Timed out waiting for node %q to exist", nodeName)
    ERROR: 		^
    ERROR: pkg/proxy/node.go:123:3: logging function "Error" should not use format specifier "%q" (logcheck)
    ERROR: 		klog.FromContext(ctx).Error(nil, "Timed out waiting for node %q to be assigned IPs", nodeName)
    ERROR: 		^
    ERROR: pkg/scheduler/backend/queue/scheduling_queue.go:610:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (p *PriorityQueue) runPreEnqueuePlugin(ctx context.Context, logger klog.Logger, pl fwk.PreEnqueuePlugin, pInfo *framework.QueuedPodInfo, shouldRecordMetric bool) *fwk.Status {
    ERROR: ^
    ERROR: pkg/scheduler/framework/plugins/dynamicresources/extendeddynamicresources.go:286:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (pl *DynamicResources) deleteClaim(ctx context.Context, claim *resourceapi.ResourceClaim, logger klog.Logger) error {
    ERROR: ^
    ERROR: pkg/scheduler/framework/plugins/dynamicresources/extendeddynamicresources.go:499:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (pl *DynamicResources) waitForExtendedClaimInAssumeCache(
    ERROR: ^
    ERROR: pkg/scheduler/framework/plugins/dynamicresources/extendeddynamicresources.go:528:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (pl *DynamicResources) createExtendedResourceClaimInAPI(
    ERROR: ^
    ERROR: pkg/scheduler/framework/plugins/dynamicresources/extendeddynamicresources.go:592:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (pl *DynamicResources) unreserveExtendedResourceClaim(ctx context.Context, logger klog.Logger, pod *v1.Pod, state *stateData) {
    ERROR: ^
    ERROR: pkg/scheduler/framework/runtime/batch.go:171:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (b *OpportunisticBatch) batchStateCompatible(ctx context.Context, logger klog.Logger, pod *v1.Pod, signature fwk.PodSignature, cycleCount int64, state fwk.CycleState, nodeInfos fwk.NodeInfoLister) bool {
    ERROR: ^
    ERROR: staging/src/k8s.io/component-base/featuregate/feature_gate.go:890:4: Additional arguments to Info should always be Key Value pairs. Please check if there is any key or value missing. (logcheck)
    ERROR: 			logger.Info("Warning: SetEmulationVersionAndMinCompatibilityVersion will change already queried feature", "featureGate", feature, "oldValue", oldVal, newVal)
    ERROR: 			^
    ERROR: test/images/sample-device-plugin/sampledeviceplugin.go:108:2: logging function "Info" should not use format specifier "%s" (logcheck)
    ERROR: 	logger.Info("pluginSocksDir: %s", pluginSocksDir)
    ERROR: 	^
    ERROR: test/images/sample-device-plugin/sampledeviceplugin.go:123:2: logging function "Info" should not use format specifier "%s" (logcheck)
    ERROR: 	logger.Info("CDI_ENABLED: %s", cdiEnabled)
    ERROR: 	^

While waiting for this to merge, another call was added which also doesn't
follow conventions:

    ERROR: pkg/kubelet/kubelet.go:2454:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (kl *Kubelet) deletePod(ctx context.Context, logger klog.Logger, pod *v1.Pod) error {
    ERROR: ^

Contextual logging has been beta and enabled by default for several releases
now. It's mostly just a matter of wrapping up and declaring it GA. Therefore
the calls which directly call WithName or WithValues (always have an effect)
are left as-is instead of converting them to use the klog wrappers (support
disabling the effect). To allow that, the linter gets reconfigured to not
complain about this anymore, anywhere.

The calls which would have to be fixed otherwise are:

    ERROR: pkg/kubelet/cm/dra/claiminfo.go:170:11: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger = logger.WithName("dra-claiminfo")
    ERROR: 	         ^
    ERROR: pkg/kubelet/cm/dra/healthinfo.go:45:11: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger = logger.WithName("dra-healthinfo")
    ERROR: 	         ^
    ERROR: pkg/kubelet/cm/dra/healthinfo.go:89:11: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger = logger.WithName("dra-healthinfo")
    ERROR: 	         ^
    ERROR: pkg/kubelet/cm/dra/healthinfo.go:157:11: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger = logger.WithName("dra-healthinfo")
    ERROR: 	         ^
    ERROR: pkg/kubelet/cm/dra/manager.go:175:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-manager")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/manager.go:239:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-manager")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/manager.go:593:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-manager")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/manager.go:781:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(context.Background()).WithName("dra-manager")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/manager.go:898:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-manager")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/manager_test.go:1638:15: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 				logger := klog.FromContext(streamCtx).WithName(st.Name())
    ERROR: 				          ^
    ERROR: pkg/kubelet/cm/dra/plugin/dra_plugin.go:77:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-plugin")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/plugin/dra_plugin.go:108:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-plugin")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/plugin/dra_plugin.go:161:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-plugin")
    ERROR: 	          ^
    ERROR: staging/src/k8s.io/dynamic-resource-allocation/resourceslice/tracker/tracker.go:695:14: function "WithValues" should be called through klogr.LoggerWithValues (logcheck)
    ERROR: 			logger := logger.WithValues("device", deviceID)
    ERROR: 			          ^
    ERROR: test/integration/apiserver/watchcache_test.go:42:54: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	etcd0URL, stopEtcd0, err := framework.RunCustomEtcd(klog.FromContext(ctx).WithName("etcd0"), "etcd_watchcache0", etcdArgs)
    ERROR: 	                                                    ^
    ERROR: test/integration/apiserver/watchcache_test.go:47:54: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	etcd1URL, stopEtcd1, err := framework.RunCustomEtcd(klog.FromContext(ctx).WithName("etcd1"), "etcd_watchcache1", etcdArgs)
    ERROR: 	                                                    ^
    ERROR: test/integration/scheduler_perf/scheduler_perf.go:1149:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 		logger = logger.WithName(tCtx.Name())
    ERROR: 		         ^
2026-03-04 12:08:18 +01:00
Maciej Skoczeń
912bf9c4ef Use a single RunPermitPlugins function and call AddWaitingPod outside a framework 2026-03-02 15:14:12 +00:00
Mads Jensen
f11bb48738 Remove redundant re-assignment in for-loops under pkg
This the forvar rule from modernize. The semantics of the for-loop
changed from Go 1.22 to make this pattern obsolete.
2026-03-02 08:47:43 +01:00