Commit Graph

254 Commits

Author SHA1 Message Date
Wei Huang
939e98135c
sched: fix goroutine leak in unit tests 2022-01-22 22:53:11 -08:00
Wei Huang
2433b083a9
clear pod's .status.nominatedNodeName when necessary 2021-12-16 10:55:13 -08:00
Abdullah Gharaibeh
33a04dc5f5 Added an integration test for NodeResourcesFit scoring 2021-11-30 12:13:30 -05:00
kerthcet
a6f695581b remove legacy scheduler policy config, as well as associated flags policy-config-file, policy-configmap, policy-configmap-namespace and use-legacy-policy-config
Signed-off-by: kerthcet <kerthcet@gmail.com>
2021-10-08 23:57:49 +08:00
Wei Huang
3b64c1b01d
sched: de-duplicate plugin registration logic by using FactoryAdapter 2021-09-20 10:12:34 -07:00
Wei Huang
a55af2d35a
cleanup duplicated import of "k8s.io/apimachinery/pkg/runtime" 2021-09-17 14:13:15 -07:00
Wei Huang
a689ad4cda
sched: start dynamicInformerFactory along with regular informerFactory (#105016)
* sched: start dynamicInformerFactory along with regular informerFactory

* fixup: start all informers and then wait for their syncs
2021-09-16 19:33:00 -07:00
Konstantin Misyutin
29bd66d018 Remove "pkg/controller/volume/scheduling" dependency from "pkg/scheduler/framework/plugins"
All dependencies of VolumeBinding plugin from
"k8s.io/kubernetes/pkg/controller/volume/scheduling" package moved to
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding" package:

- whole file pkg/controller/volume/scheduling/scheduler_assume_cache.go
- whole file pkg/controller/volume/scheduling/scheduler_assume_cache_test.go
- whole file pkg/controller/volume/scheduling/scheduler_binder.go
- whole file pkg/controller/volume/scheduling/scheduler_binder_fake.go
- whole file pkg/controller/volume/scheduling/scheduler_binder_test.go

Package "k8s.io/kubernetes/pkg/controller/volume/scheduling/metrics" moved
to "k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding/metrics"
because it only used in VolumeBinding plugin and (e2e) tests.

More described in issue #89930 and PR #102953.

Signed-off-by: Konstantin Misyutin <konstantin.misyutin@huawei.com>
2021-08-13 19:08:45 +08:00
Wei Huang
dc079acc2b
sched: retry unschedule pods immediately after a waiting pod's deletion 2021-08-06 19:08:37 -07:00
Jerry-Ge
570365178a merge packages of scheduler/core and scheduler
Signed-off-by: Jerry Ge <jerry.ge@arm.com>
2021-07-05 14:21:32 +08:00
Hidehito Yabuuchi
e371b27e6c Fix frameworkImpl.extenders being not set 2021-06-19 18:07:31 +09:00
Abdullah Gharaibeh
265ef1741f Move scheduler plugin set and configuration defaulting to component config 2021-06-16 10:15:29 -04:00
Wei Huang
36eaa11d50
cleanup usage of NewPodNominator
- replace NewPodNominator() with NewSafePodNominator()
- rename nominatedPodMap to nominator
2021-06-10 14:01:07 -07:00
Jerry-Ge
110c39ef60 unroll extenders
Signed-off-by: Jerry Ge <jerry.ge@arm.com>

Co-authored-by: Huang-Wei <wei.huang1@ibm.com>
2021-06-10 08:31:44 +08:00
Mike Dame
5a77ebe28b Scheduler: remove pkg/features dependency from NodeResources plugins 2021-05-18 08:59:02 -04:00
Kubernetes Prow Robot
ed3e0d302f
Merge pull request #100644 from Huang-Wei/sched-fwk-config
Surface kube config in scheduler framework handle
2021-04-12 19:12:49 -07:00
Niekvdplas
fec272a7b2 Fixed several spelling mistakes 2021-03-30 23:02:09 +02:00
Wei Huang
e7f67b1a63
Surface kube config in scheduler framework handle 2021-03-30 11:54:59 -07:00
Mengxue Zhang
b38caa91cc make runtime.NewFramework accept KubeSchedulerProfile 2021-03-05 18:30:21 +00:00
Abdullah Gharaibeh
c7fef196b6 Implements pod affinity NamespaceSelector feature 2021-03-04 07:30:24 -05:00
drfish
bc2df9de72 Use PodInfo instead of Pod for nominatedPods and QueuedPodInfo 2021-02-22 22:00:23 +08:00
drfish
74315f9c56 Change config.Plugins from pointers to objects 2021-02-10 23:45:59 +08:00
Wei Huang
f8a6bdb044
Surface info of failed plugins during PerFilter and Filter 2021-01-28 12:20:42 -08:00
Jie Shen
b79c2ebd7e Wrap errors for framework/runtime 2021-01-26 13:48:58 +08:00
Dave Chen
7315c1f6dd Show the details on the failure of preemption
Since the filter status is missed for the phase of preemption, there
will be no way to tell why the preemption failed for some reasons, and
those reasons could be different with the status from the main scheduling
process (the first failed plugin will hide other failures in the chain).

This change provides verbose information based on the node status generated
during pod preemption, those information helps us to diagnose the issue which
is happened during pod preemption.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2021-01-15 23:20:17 +08:00
Yixiang2019
842cc6b4e2 cleanup: fix log capitalization in scheduler
Signed-off-by: Yixiang2019 <wang.yixiang@zte.com.cn>
2020-11-12 20:10:26 +08:00
tangwz
5f3efa671d scheduler: make Profile an interface. 2020-10-27 09:13:04 +08:00
Ali
09b2e8f638 Move scheduler interface to pkg/scheduler/framework 2020-10-13 13:13:27 +11:00
SataQiu
47c58c3785 using structured logging in scheduler framework runtime 2020-09-24 21:54:31 +08:00
Kubernetes Prow Robot
965137a992
Merge pull request #94692 from alculquicondor/wrap_errors_min
Wrap errors from VolumeBinding and DefaultBinder plugins
2020-09-15 18:27:34 -07:00
Wei Huang
185ba08fcd
Move podPassesBasicChecks() to VolumeBinding plugin 2020-09-11 13:54:02 -07:00
Wei Huang
42cfda2f94
Remove pvcLister from genericScheduler
PVCLister can be fetched from sharedInformerFactory.
2020-09-11 13:54:01 -07:00
Aldo Culquicondor
a482d7ef8e Wrap errors when running PreBind plugins
Signed-off-by: Aldo Culquicondor <acondor@google.com>
Change-Id: I31bf35d7e96b1cebb285cf03ffad310d83224d9c
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-09-10 16:22:12 -04:00
Wei Huang
eb3d2de543
Remove field disablePreemption from internal scheduler codebase 2020-09-10 13:06:42 -07:00
Wei Huang
d8def59871
Initialize scheduler's podInformer in sharedInformerFactory
Scheduler's specific podInfomer is now initialized inside the sahredInformerFactory.
2020-09-08 12:57:17 -07:00
Kubernetes Prow Robot
06eb495a0f
Merge pull request #93896 from alculquicondor/speed-up-volume-binding-test
Improve running time of TestSchedulerWithVolumeBinding
2020-08-26 19:41:10 -07:00
Kubernetes Prow Robot
3647766cbc
Merge pull request #93938 from alculquicondor/revert-node-delete
Keep track of remaining pods when a node is deleted
2020-08-13 13:25:41 -07:00
Aldo Culquicondor
16d7ecfa45 Remove direct accesses to cache's node map
Signed-off-by: Aldo Culquicondor <acondor@google.com>
Change-Id: Iebb22fc816926aaa1ddd1e4b2e52f335a275ffaa
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-08-13 14:22:06 -04:00
Kubernetes Prow Robot
4750523bac
Merge pull request #93893 from alculquicondor/fix-scheduler-test
Sync cache before starting scheduler test
2020-08-11 15:31:46 -07:00
Aldo Culquicondor
1978866474 Improve running time of TestSchedulerWithVolumeBinding
Only wait for finished binding or error, but not both

Signed-off-by: Aldo Culquicondor <acondor@google.com>
Change-Id: I13d16e6c7c45c6527591aa05cc79fc5e96d47a68
2020-08-11 17:31:29 -04:00
Aldo Culquicondor
24f817a487 Sync cache before starting scheduler test
Signed-off-by: Aldo Culquicondor <acondor@google.com>
Change-Id: I9629e1d6d510607b505b0302e23d67e0ae4a662e
2020-08-11 13:36:54 -04:00
Yecheng Fu
1176ef9c7d forget the pod when the reserve plugins fail
and move the metrics function calls before all other functions
2020-08-11 21:28:33 +08:00
Chelsey Chen
ade2422883 Switch event recorder to use events.k8s.io/v1 2020-07-02 14:50:41 -04:00
Kubernetes Prow Robot
ad29e168dc
Merge pull request #92108 from Huang-Wei/postfilter-impl-4
[postfilter-impl-4] Move Preempt() to defaultpreemption package.
2020-06-27 09:02:15 -07:00
Wei Huang
058e3d4258
Move Preempt() and its related functions to defaultpreemption package
Refactor genericScheduler and signature of preemption funcs
  - remove podNominator from genericScheduler
  - simplify signature of preemption functions

Make Preempt() private
2020-06-25 12:33:51 -07:00
Adhityaa Chandrasekar
ec83143342 scheduler: merge Reserve and Unreserve plugins
Previously, separate interfaces were defined for Reserve and Unreserve
plugins. However, in nearly all cases, a plugin that allocates a
resource using Reserve will likely want to register itself for Unreserve
as well in order to free the allocated resource at the end of a failed
scheduling/binding cycle. Having separate plugins for Reserve and
Unreserve also adds unnecessary config toil. To that end, this patch
aims to merge the two plugins into a single interface called a
ReservePlugin that requires implementing both the Reserve and Unreserve
methods.
2020-06-24 21:10:35 +00:00
Yecheng Fu
4627b419b4 tests only 2020-06-23 22:18:33 +08:00
Aldo Culquicondor
eb9711dc1f Add profile label to schedule_attempts_total metric
and e2e_scheduling_duration_seconds

Also adding result label to e2e_scheduling_duration_seconds. Previously, the metric was only updated for successful attempts

Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-06-22 15:19:57 -04:00
Ali Farah
a22e115a0e Split scheduler framework implementation into new runtime package 2020-06-22 00:23:43 +10:00
Wei Huang
196056d7fe
Introduce a defaultpreemption PostFilter plugin
- Add a defaultpreemption PostFilter plugin
- Make g.Preempt() stateless
    - make g.Preempt() stateless
    - make g.getLowerPriorityNominatedPods() stateless
    - make g.processPreemptionWithExtenders() stateless
2020-06-19 09:13:55 -07:00
Wei Huang
36c8ecc98c
Refactor scheduler preempt interface
- replace error with NodeToStatusMap in Preempt() signature
- eliminate podPreemptor interface and expose its functions statelessly
- move logic in scheduler.go#preempt to generic_scheduler.go#Preempt()
2020-06-15 08:42:00 -07:00
Yecheng Fu
c4138361e4 Fail fast in PreFilter phase and return UnschedulableAndUnresolvable if immediate PVCs are not bound 2020-06-12 10:00:19 +08:00
Wei Huang
51a9dcce22
Revert "Fix an issue that a Pod's nominatedNodeName cannot be cleared when the nominated node is deleted"
This reverts commit 369a9001c6.
2020-06-09 16:47:37 -07:00
Kubernetes Prow Robot
5248bef370
Merge pull request #91750 from Huang-Wei/clear-nnn
Fix an issue that a Pod's nominatedNodeName cannot be cleared upon node deletion
2020-06-08 21:43:58 -07:00
Wei Huang
369a9001c6
Fix an issue that a Pod's nominatedNodeName cannot be cleared when the nominated node is deleted 2020-06-03 17:45:06 -07:00
Yecheng Fu
1ff09c0934 Remove BindTimeoutSeconds from KubeSchedulerConfiguration 2020-06-03 09:54:06 +08:00
Abdullah Gharaibeh
27caa6e727 merge pod condition update with setting nominated node name in the scheduler 2020-05-28 20:11:16 -04:00
Kubernetes Prow Robot
73641d35c7
Merge pull request #91451 from gaurav1086/scheduler_test_fix_goroutine_leak
scheduler_test: fix goroutine leak
2020-05-26 21:09:03 -07:00
Gaurav Singh
a4e5629320 scheduler_test: fix goroutine leak
Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>

Re-use errchan from setupTestSchedulerWithOnePodOnNode

Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
2020-05-26 17:33:10 -04:00
Wei Huang
59eff29d22
- Add Extenders() and PluginsRunner interface to PreemptHandle
- Make some private functions stateless
  - make addNominatedPods() not dependent on genericScheduler
  - make addNominatedPods() not dependent on genericScheduler
  - make selectVictimsOnNode() not dependent on genericScheduler
  - make selectNodesForPreemption() not dependent on genericScheduler
2020-05-26 10:00:45 -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
Kubernetes Prow Robot
57b79e3fb4
Merge pull request #91037 from Huang-Wei/prefactor-PreemptExtender
Refactor preemption extender logic and move SchedulerExtender interface to framework pkg
2020-05-15 02:48:30 -07:00
Brian Pursley
9eb8e7a6d6 Changed scheduler to use patch when updating pod status to avoid potential conflicts 2020-05-14 15:17:53 -04:00
Wei Huang
eb17b7559c
move SchedulerExtender interface to pkg/scheduler/framework/v1alpha1 2020-05-13 13:09:13 -07:00
Wei Huang
e4f878ea3a
cleanup: use string instead of v1.Node as key of nodeToVictims 2020-05-13 13:08:20 -07:00
Yecheng Fu
c14b749521 scheduler/volumebinding: move all volume binding logic into VolumeBinding plugin 2020-05-12 10:13:05 +08:00
Wei Huang
e283e73994
Remove enableNonPreempting field from scheduler codebase 2020-05-08 19:02:51 -07:00
Abdullah Gharaibeh
a151682887 Split scheduler's PodInfo into two types, PodInfo and PodQueueInfo 2020-04-21 21:45:20 -04:00
Aldo Culquicondor
ce05382b58 Use RawExtension and Object for external and internal scheduling plugin args, respectively
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-04-14 13:44:42 -04:00
Abdullah Gharaibeh
b8ddd00312 scheduler's NodeInfo tracks PodInfos instead of Pods 2020-04-08 17:53:20 -04:00
Abdullah Gharaibeh
a5d8172715 move nodeinfo type to framework pkg 2020-04-07 10:25:24 -04:00
Abdullah Gharaibeh
ed3fe054df move scheduler nodeinfo to pkg/scheduler/types 2020-03-31 21:02:09 -04:00
louisgong
c6b94e4606 refactor volume binder 2020-02-29 12:03:39 +08:00
Patrick Ohly
6329b17d2f volume scheduler: introduce special string type
This makes it possible to search for the special strings more easily
(https://github.com/kubernetes/kubernetes/pull/88230#discussion_r382367043).
2020-02-28 10:09:19 +01:00
Patrick Ohly
6eb0b034ac volume scheduler: move reason strings into volume code
The scheduler doesn't really need to know in detail which reasons
rendered a node unusable for a node. All it needs from the volume
binder is a list of reasons that it then can present to the user.

This seems a bit cleaner. But the main reason for the change is that
it simplifies the checking of CSI inline volumes and perhaps later
capacity checking. Both will lead to new failure reasons, which then
can be added without changing the interface.
2020-02-28 10:09:18 +01:00
Aldo Culquicondor
07c4982245 Add unit and integration tests for multiple profiles support
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-02-26 10:14:03 -05:00
Aldo Culquicondor
c048858471 Support multiple scheduling profiles in a single scheduler
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-02-25 11:31:20 -05:00
notpad
89066cceb9 Add RegisterPluginAsExtensionsWithWeight 2020-02-11 23:11:53 +08:00
notpad
a7057f8df0 Cleanup "slow-path" logic in scheduler Filters 2020-02-10 22:48:49 +08:00
Aldo Culquicondor
4a5ab84dcc Move default binding to a plugin
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-01-22 14:13:33 -05:00
Kubernetes Prow Robot
8cd0c42845
Merge pull request #87407 from haosdent/remove-registry-args
Deprecate scheduler's framework.plugins.RegistryArgs
2020-01-21 16:26:57 -08:00
Haosdent Huang
50d511d4b8 Deprecate scheduler's framework.plugins.RegistryArgs 2020-01-21 23:50:58 +08:00
zouyee
d6b449b5c7 Move scheduler's SchedulerExtender interface to core/extenders.go
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
2020-01-21 20:20:20 +08:00
Aldo Culquicondor
eb265bc7db Remove GetBinder member and replace it with a method.
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-01-20 14:10:02 -05:00
Aldo Culquicondor
7a39e1396a Remove unnecessary slow binding test
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-01-20 11:49:45 -05: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
c712230ac1
Implement default queue sort logic as a scheduler plugin 2020-01-16 19:10:43 -08:00
Abdullah Gharaibeh
fb66e807cd Remove scheduler framework dependency on predicates package 2020-01-13 13:02:31 -05:00
draveness
2c3c6721ce refactor(scheduling): remove priorities package 2020-01-10 09:05:39 +08:00
Wei Huang
64d7b224d9
Cleanup unused parameter of NewGenericScheduler 2020-01-03 11:42:39 -08:00
Kubernetes Prow Robot
26b52e84a4
Merge pull request #86230 from hex108/skip_schedule
Scheduler handles pod annotation updates during scheduling more gracefully
2019-12-31 17:03:40 -08:00
Jun Gong
706e90a033 Skip scheduling the pod if it has been assumed and the pod updates could be skipped. 2019-12-31 14:21:41 +08:00
Abdullah Gharaibeh
2b3df3587e Deprecate scheduler predicate and priority factory registration 2019-12-25 20:33:08 -05:00
Abdullah Gharaibeh
fe7de96ebe cleanup scheduler's in-tree plugins registry naming 2019-12-24 15:56:36 -05:00
Kubernetes Prow Robot
06fb3eb582
Merge pull request #86496 from ahg-g/ahg1-check
Support AlwaysCheckAllPredicates in the scheduler framework.
2019-12-23 09:53:33 -08:00
Kubernetes Prow Robot
ff975e865d
Merge pull request #86498 from Huang-Wei/deprecate-failedPredicateMap
Cleanup failedPredicateMap from generic_scheduler.go
2019-12-21 08:41:33 -08:00
Abdullah Gharaibeh
eeb8a5b728 Added back the flag to trigger examining all Filters in the scheduler. 2019-12-21 05:17:23 -05:00
Wei Huang
3e65b3793f
Cleanup failedPredicateMap from generic_scheduler.go 2019-12-20 15:18:15 -08:00
Wei Huang
1f78a936d4
Deprecate AlwaysCheckAllPredicates in scheduler Policy API 2019-12-20 11:41:33 -08:00
Abdullah Gharaibeh
770e51cd10 Deprecate PredicateMetadata 2019-12-17 08:02:59 -05:00