Commit Graph

307 Commits

Author SHA1 Message Date
Yuan Chen
971e0c4400
Fix a typo in comment 2021-07-21 16:19:22 -07:00
Wei Huang
fb9cafc99b
sched: provide an option for plugin developers to move pods to activeQ 2021-07-07 12:50:12 -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
Marwan Ahmed
48dfa2a554 generate scheduler merge patches on the pod status instead of the full pod 2021-06-28 09:35:55 -07:00
Abdullah Gharaibeh
265ef1741f Move scheduler plugin set and configuration defaulting to component config 2021-06-16 10:15:29 -04:00
Kubernetes Prow Robot
8955463c17
Merge pull request #102745 from ahg-g/ahg-provider
Remove SchedulerAlgorithmSource from scheduler's internal CC API
2021-06-10 07:17:39 -07:00
Kubernetes Prow Robot
521be6344e
Merge pull request #102558 from Jerry-Ge/unroll-extenders
Unroll ScheduleAlgorithm#Extenders() to Scheduler.go
2021-06-10 07:17:27 -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
Abdullah Gharaibeh
52f5ba3a58 Remove SchedulerAlgorithmSource from scheduler's internal CC API 2021-06-09 19:14:54 -04:00
Adhityaa Chandrasekar
3c8e56bef9 scheduler: graduate CC to v1beta2, deprecate plugins
Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>
2021-06-07 12:42:55 +00:00
Wei Huang
1b3a124ba6
Scheduler now registers event handlers dynamically
- move clusterEventMap to Configurator
- dynamic event handlers registration for core API resources
- dynamic event handlers registration for custom resources
2021-05-21 13:47:06 -07: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
Kubernetes Prow Robot
b678d1b51d
Merge pull request #100444 from july2993/mode
Change go file mode from 755 to 644
2021-04-08 22:09:22 -07:00
Wei Huang
e7f67b1a63
Surface kube config in scheduler framework handle 2021-03-30 11:54:59 -07:00
tanjing2020
d4465b995e Scheduler: skip updates of assumed pods 2021-03-24 10:01:22 +08:00
Jiahao Huang
4621722888 Change go file mode from 755 to 644
to check all file:
find . -perm 755 | grep "\.go$"
2021-03-23 10:50:17 +08:00
drfish
c2ceb21a3e Make parallelism as part of schedulerOptions 2021-03-09 23:25:55 +08:00
drfish
bc2df9de72 Use PodInfo instead of Pod for nominatedPods and QueuedPodInfo 2021-02-22 22:00:23 +08:00
carlory
0b730f04ce fix kube-scheduler cannot send event because the Note field is too large 2021-02-04 10:36:11 +08:00
Wei Huang
f8a6bdb044
Surface info of failed plugins during PerFilter and Filter 2021-01-28 12:20:42 -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
Alex Dudko
b11e4f2484 Migrate scheduler.go, factory.go to structured logging 2020-12-24 18:50:30 -08:00
Alex Dudko
c03b4c7850 Migrate pkg/scheduler logs to structured logging
in pkg/scheduler/eventhandlers.go
  * add event for unscheduled pod
  * delete event for unscheduled pod
  * add event for scheduled pod
  * delete event for scheduled pod

in pkg/scheduler/framework/plugins/defaultbinder/default_binder.go
  * Attempting to bind pod to node

in pkg/scheduler/scheduler.go
  * Updating pod condition
  * Attempting to schedule pod
  * Skip schedule deleting pod
2020-12-18 10:45:00 -08:00
Kubernetes Prow Robot
989b2fd371
Merge pull request #97221 from 249043822/br-scheduler-metrics
cleanup constants for scheduler metrics
2020-12-14 17:45:56 -08:00
Kubernetes Prow Robot
bd4d197b52
Merge pull request #96447 from chendave/bind_postfilter
Remove the deprecated metrics from scheduler
2020-12-14 06:31:28 -08:00
Dave Chen
5144e2ec78 Remove the deprecated metrics from scheduler
Deprecated metrics are removed and suggest to use the Histogram
metrics got from scheduler extension points.

Signed-off-by: Dave Chen <dave.chen@arm.com>
Co-authored-by: wawa0210 <xiaozhang0210@hotmail.com>
2020-12-14 11:31:50 +08:00
KeZhang
1208c53c8b cleanup constants for scheduler metrics 2020-12-11 14:22:20 +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
lixiaobing1
6a41d81264 remove annotation cache sync because of code removed 2020-11-06 18:41:08 +08:00
Kubernetes Prow Robot
d0bee69fc9
Merge pull request #94636 from hprateek43/cpu_threads_parameter
Added config parameter for CPU threads
2020-10-29 21:04:05 -07:00
Harsh Singh
1763688d71 Added config parameter for CPU threads 2020-10-29 12:16:10 +05:30
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
Kubernetes Prow Robot
44cd4fcedc
Merge pull request #95001 from arghya88/deprecate-scheduler-metrics
deprecate scheduler metrics
2020-09-24 13:57:48 -07:00
Dave Chen
a9b71c198b Use the exported struct member directly
Signed-off-by: Dave Chen <dave.chen@arm.com>
2020-09-24 16:15:11 +08:00
Arghya Sadhu
078b355da3 deprecate scheduler metrics BindingLatency and SchedulingAlgorithmPreemptionEvaluationDuration 2020-09-23 17:15:13 +05:30
Arghya Sadhu
c62f0dd165 removing deprecated scheduler metrics 2020-09-22 21:04:15 +05:30
Jimmy Zhang
1f0bcc8f5d optimize the use of informer for scheduler 2020-09-15 18:21:40 +08: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
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
Wei Huang
0e71facefe
Hold Pod in cache until all other cleanup work is completed
- Move "ForgetPod" after "RunReservePluginsUnreserve", so that the cache would hold the pod to
  avoid it's being retried simutaneously until Unreserve is completed.
- Move "assume" ahead of "RunReservePluginsReserve". This is based on the fact that "ForgetPod" is
  the last step of failure path, so "assume" should be reversly treated as the first step. The
  current failure path is like this:
  assume -> reserve -> unreserve -> forgetPod -> recordingFailure
- Make subtests of TestReservePluginUnreserve stateless
2020-07-29 11:27:19 -07:00
Jordan Liggitt
124a5ddf72 Fix int->string casts 2020-07-24 16:23:12 -04:00
Wei Huang
4b26ef2217
Remove DisablePreemption field from SchedulerConfig v1beta1
DisablePreemption field can be removed as it can be deduced from PostFilterPlugins.
2020-07-08 09:58:42 -07:00
Abdullah Gharaibeh
d1ea49bcd9 breakdown PodSchedulingDuration by number of attempts 2020-07-01 17:34:07 -04:00
Adhityaa Chandrasekar
1b223b861a scheduler: run Unreserve if Reserve fails
If a reserve plugin's Reserve method returns an error, there could be
previously allocated resources from successfully completed reserve
plugins that must be unallocated by the corresponding Unreserve
operation. Since Unreserve operations are idempotent, this patch runs
the Unreserve operation of ALL reserve plugins when a Reserve operation
fails.
2020-06-26 20:41:33 +00: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
Kubernetes Prow Robot
83a15867b1
Merge pull request #92049 from Huang-Wei/postfilter-impl-3
[postfilter-impl-3] Register and enable the defaultpreemption plugin
2020-06-22 23:53:54 -07:00
Wei Huang
d99cc01646
Register and enable defaultpreemption plugin
- Enable defaultpreemption as a PostFilter plugin
- Remote legacy hard-coded preemption logic
2020-06-22 17:22:27 -07: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
tanjunchen
7fe9f3451f Migrate to log calls to klog.ErroS for pkg/scheduler 2020-06-09 18:39:58 -07:00
Wei Huang
69b9ba6012
Introduce PostFilter extension point 2020-06-05 13:23:45 -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
Wei Huang
bd184035c4
Extract logic related with scheduler nominatedPods to an interface
- rename `UpdateNominatedPodForNode` to `AddNominatedPod`
- promote `update` to `UpdateNominatedPod`
- anonymous lock in nominatedMap
- pass PodNominator as an option to NewFramework
2020-05-18 10:29:08 -07:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04: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
Kubernetes Prow Robot
5bda0c1b3b
Merge pull request #83726 from cofyc/fix56180
scheduler: Move all volume binding code into VolumeBinding plugin
2020-05-14 10:08:23 -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
Abdullah Gharaibeh
c3be8feee6 count no nodes scheduling failure as unschedulable instead of error 2020-05-11 14:07:52 -04: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
skilxn-go
e0adb0ead9 Add compatibility tests for plugin config 2020-03-24 22:17:16 +08:00
Kubernetes Prow Robot
4319ab214f
Merge pull request #89219 from chendave/misspelling
Trival fix: update the description on the pod preemption
2020-03-20 17:58:44 -07:00
Dave Chen
a9d82e7c2a Trival fix: update the description on the pod preemption
`pod` has the field of `NominatedNodeName` which is different
with `NominatedPod`.
2020-03-18 18:23:36 +08:00
Aldo Culquicondor
4d6af4d8d8 Set unschedulable Condition after setting nominated Node
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-03-13 11:02:19 -04:00
Kubernetes Prow Robot
5708511499
Merge pull request #88708 from mikedanese/deleteopts
Migrate clientset metav1.DeleteOpts to pass-by-value
2020-03-05 23:09:23 -08:00
Mike Danese
c58e69ec79 automated refactor 2020-03-05 14:59:46 -08:00
Mike Dame
1d7006c38d Add Extenders to scheduler v1alpha2 component config 2020-03-05 16:42:15 -05:00
louisgong
c6b94e4606 refactor volume binder 2020-02-29 12:03:39 +08: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
Mateusz
d221d82eaf run permit plugins in the scheduling cycle 2020-02-18 10:04:23 -08:00
Aldo Culquicondor
99bda6fac0 Remove HardPodAffinityWeight from v1alpha2
Signed-off-by: Aldo Culquicondor <acondor@google.com>
2020-02-13 11:59:56 -05:00
Mike Danese
25651408ae generated: run refactor 2020-02-08 12:30:21 -05:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
Shingo Omura
c9c4be66d3 Fix pending_pods, schedule_attempts_total was not recorded
because metric initializations are too early. This causes actual metric
instance become no-op.

modification made in thie commit to make sure actual metric instance won't be no-op metrics:

- re-initialize scheduler/metrics.PodSchedule{Successes, Failure, Errors} after metric creation
- scheduler/metrics.Register() should be called before initializing SchedulingQueue,
2020-01-31 17:03:41 +09: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
Haosdent Huang
50d511d4b8 Deprecate scheduler's framework.plugins.RegistryArgs 2020-01-21 23:50:58 +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
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
danielqsj
85931af1ee remove deprecated metrics of scheduler 2020-01-10 17:03:40 +08:00
sunxiaofei03
6c58cc0ad0 change framework_extension_point_duration_seconds from sampling to always record 2020-01-09 12:23:05 +08:00
Kubernetes Prow Robot
b3c4c90a72
Merge pull request #86673 from ahg-g/ahg1-provider
Define algorithm providers in terms of plugins
2020-01-02 22:25:53 -08:00
Kubernetes Prow Robot
fdfcb00ede
Merge pull request #86586 from xiaoanyunfei/cleanup/deprecate_scheduler_duration_seconds
Deprecate scheduling_duration_seconds Summary metric
2020-01-02 19:15:55 -08:00
Abdullah Gharaibeh
b535ed3b0c Merge scheduler's ConfigProducerRegistry into LegacyRegistry 2020-01-02 16:40:33 -05: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
Abdullah Gharaibeh
a6b7b0d95e Define algorithm providers in terms of plugins. 2019-12-31 15:28:09 -05: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
fe7de96ebe cleanup scheduler's in-tree plugins registry naming 2019-12-24 15:56:36 -05:00
sunxiaofei03
70b80ae28a Deprecate scheduling_duration_seconds Summary metric 2019-12-24 19:17:29 +08:00
Kubernetes Prow Robot
f4caa62593
Merge pull request #85590 from yuzhiquan/master
handle registry merge error
2019-12-04 08:50:57 -08:00
Dc.Hannibal
9a9db00451 handle registry merge error
Handle registry merge error.

Add test case

Add a test case in TestSchedulerCreation

Add test case comment

Add test case comment, and modify error msg.

gofmt

gofmt import order

replace NewDefaultRegistry with a fake registry

update comment

rename framework plugins nodeaffinity import

remove nodeaffinity plugin import, get fake registry name from default registry randomly

Add a space

Add a space after //

update comment, trans FrameWork to Framework
2019-12-04 09:21:18 +08:00
Abdullah Gharaibeh
f388534082 make scheduling queue start before the scheduler starts and stops after the scheduler stops 2019-12-02 14:35:09 -05:00
Kubernetes Prow Robot
9b75e36436
Merge pull request #85294 from ahg-g/ahg-15k
Rename PluginConfigArgs to AlgorithmConfigArgs
2019-11-14 11:20:11 -08:00
Kubernetes Prow Robot
78d2e52dee
Merge pull request #84859 from denkensk/move-volumebind-behind-permit
Move pod bindVolumes behind RunPermitPlugins
2019-11-14 10:05:48 -08:00
Abdullah Gharaibeh
05606bb6e4 rename PluginConfigArgs to AlgorithmConfigArgs 2019-11-14 11:30:59 -05:00