Commit Graph

1067 Commits

Author SHA1 Message Date
Davanum Srinivas
9405e9b55e
Check in OWNERS modified by update-yamlfmt.sh
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-12-09 21:31:26 -05:00
Kubernetes Prow Robot
d7f8234b6d
Merge pull request #106747 from ahg-g/ahg-test
Added an integration test for NodeResourcesFit scoring
2021-12-07 19:28:06 -08:00
Kubernetes Prow Robot
75109026d0
Merge pull request #106447 from hyschumi/fix-noderesources
cleanup duplicated method `makeNodeWithExtendedResource` in noderesources unit test
2021-12-07 17:27:10 -08:00
Abdullah Gharaibeh
33a04dc5f5 Added an integration test for NodeResourcesFit scoring 2021-11-30 12:13:30 -05:00
boenn
cec2aae1e5 rebase master 2021-11-25 11:21:12 +08:00
hyschumi
7ad629c864 rm makeNodeWithExtendedResource method in noderesources unit test && doc: update least_allocated strategy detail doc 2021-11-18 09:15:26 +08:00
Kubernetes Prow Robot
c0b5ed7556
Merge pull request #105611 from damemi/simplified-multipoint-extension
Scheduler simplified MultiPoint plugin config
2021-11-16 17:44:12 -08:00
Oksana Naumov
3af11fc12d Add support for Portworx to csi-translation lib
Signed-off-by: Oksana Naumov <trierra.dev@gmail.com>
2021-11-16 13:26:09 -08:00
Mike Dame
420c5308bb Add MultiPoint scheduler plugin config field 2021-11-16 14:56:33 -05:00
Kubernetes Prow Robot
66c342ba63
Merge pull request #95361 from humblec/rbd-migration
RBD in-tree plugin migration to CSI driver using migration translation lib
2021-11-15 19:53:25 -08:00
Humble Chirammal
7c40eb9ae0 Add support for rbd plugin to csi-translation-lib
In support of csi-migration proposal here:
https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/csi-migration.md

Will help with migration of in-tree RBD plugin ( kubernetes.io/rbd)
to RBD CSI driver ( rbd.csi.ceph.com ).

Fixes https://github.com/kubernetes/enhancements/issues/2923

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2021-11-15 23:46:29 +05:30
Shivanshu Raj Shrivastava
3142acbc8c
migrated remaining lines of server.go and csi.go to structured logging 2021-11-10 21:24:34 +05:30
Kubernetes Prow Robot
a41d166a90
Merge pull request #105904 from mengjiao-liu/structured_logging_scheduler
Migrate assume_cache.go to structured logging
2021-11-09 11:28:00 -08:00
Kubernetes Prow Robot
6ac2d8edc8
Merge pull request #105967 from shivanshu1333/feature2/master/105841
Migrated scheduler files `preemption.go`, `stateful.go`, `resource_allocation.go` to structured logging
2021-11-09 10:28:01 -08:00
Shivanshu Raj Shrivastava
f4aad52885
migrated preemption.go, stateful.go, resource_allocation.go to structured logging 2021-11-08 22:52:47 +05:30
Kubernetes Prow Robot
53addf3ba3
Merge pull request #105858 from jyz0309/migrate-log
Migrated scheduler files binder.go binder_test.go to structured logging
2021-11-02 19:01:09 -07:00
Kubernetes Prow Robot
ec8e6e8778
Merge pull request #106002 from kerthcet/feature/refactor-NodeResourcesFit-plugin
refactor scheudler's node resource plugins
2021-11-02 10:52:34 -07:00
kerthcet
e5dd375b14 refactor scheudler's node resource plugins
Signed-off-by: kerthcet <kerthcet@gmail.com>
2021-11-03 00:52:23 +08:00
Mengjiao Liu
e262e3ad2f Migrate assume_cache.go to structured logging 2021-11-01 17:43:39 +08:00
jyz0309
07bf08690c migrate log to structure log
Signed-off-by: jyz0309 <45495947@qq.com>

add klog.Kobj

Signed-off-by: jyz0309 <45495947@qq.com>

use KObj

Signed-off-by: jyz0309 <45495947@qq.com>

address comment

Signed-off-by: jyz0309 <45495947@qq.com>

remove useless var

Signed-off-by: jyz0309 <45495947@qq.com>

format code

Signed-off-by: jyz0309 <45495947@qq.com>

address comment

Signed-off-by: jyz0309 <45495947@qq.com>

use err key

Signed-off-by: jyz0309 <45495947@qq.com>

use PVC

Signed-off-by: jyz0309 <45495947@qq.com>

improve log message

Signed-off-by: jyz0309 <45495947@qq.com>

address comment

Signed-off-by: jyz0309 <45495947@qq.com>

use pod instead podName

Signed-off-by: jyz0309 <45495947@qq.com>
2021-10-31 21:11:26 +08:00
Ahmad Diaa
a2c37bfd09
use original requests in NodeResourcesBalancedAllocation instead of NonZero (#105845) 2021-10-29 19:04:14 -07:00
Kubernetes Prow Robot
adff4a75ad
Merge pull request #105931 from mengjiao-liu/structured_logging_scheduler_part2
Migrate scheduler files `interpodaffinity/filtering.go`,`podtopologyspread/filtering.go`, `volume_zone.go` to structured logging
2021-10-29 12:13:23 -07:00
Mengjiao Liu
2783ddc227 Migrate scheduler files interpodaffinity/filtering.go,podtopologyspread/filtering.go, volume_zone.go to structured logging 2021-10-29 11:41:02 +08:00
Kubernetes Prow Robot
c592bd40f2
Merge pull request #105609 from pohly/generic-ephemeral-volume-ga
generic ephemeral volume GA
2021-10-28 17:36:50 -07:00
Kubernetes Prow Robot
8e8bf06f15
Merge pull request #105796 from sanposhiho/move/parallelizer-to-non-internal
Fix: move parallelize package to non-internal file
2021-10-28 15:31:00 -07:00
Kubernetes Prow Robot
87b0412232
Merge pull request #105727 from chendave/wrong_status
Fix the inaccurate status when a plugin internal status is found
2021-10-27 19:45:02 -07:00
Dave Chen
468a6005a6 Fix the return status when a plugin internal status is found
Currently, the status code returned is `Unschedulable` when an internal error
found, the `Unschedulable` status is built from a `FitError` which means no
fit nodes found without a internal error.

Instead of build an Unschedulable status from the `FitError`, return the
Error status directly.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2021-10-28 09:43:31 +08:00
kerthcet
2c5b5533bf remove scheduler NodeLabel plugin
Signed-off-by: kerthcet <kerthcet@gmail.com>
2021-10-27 10:07:35 +08:00
Kubernetes Prow Robot
3141c984a1
Merge pull request #105907 from kerthcet/feature/remove-scheduler-plugin-nodePreferAvoidPods
remove scheduler NodePreferAvoidPods plugin
2021-10-26 18:07:41 -07:00
kerthcet
a139da6b04 remove scheduler NodePreferAvoidPods plugin
Signed-off-by: kerthcet <kerthcet@gmail.com>
2021-10-27 08:05:44 +08:00
Shivanshu Raj Shrivastava
3c87c43cef
Migrated scheduler files server.go, node_label.go, csi.go, non_csi.go to structured logging (#105855)
* migrated server.go

* fixed migration

* resolving review comments

* added storageClass

* review comments

* review comments
2021-10-26 13:21:22 -07:00
Abdullah Gharaibeh
faf0ce68a0 Remove scheduler's legacy policy config 2021-10-24 21:58:12 -04:00
sanposhiho
9dc0489c1a Fix: move parallelize package to non-internal file 2021-10-21 02:39:23 +09:00
kerthcet
fc9533e72f remove scheduler ServiceAffinity plugin
Signed-off-by: kerthcet <kerthcet@gmail.com>
2021-10-15 22:10:31 +08:00
Patrick Ohly
a8c930ef46 generic ephemeral volume: graduation to GA
The feature gate gets locked to "true", with the goal to remove it in two
releases.

All code now can assume that the feature is enabled. Tests for "feature
disabled" are no longer needed and get removed.

Some code wasn't using the new helper functions yet. That gets changed while
touching those lines.
2021-10-11 20:54:20 +02:00
Patrick Ohly
bc263f3ba5 scheduler: use generic ephemeral volume helper functions
The name concatenation and ownership check were originally considered small
enough to not warrant dedicated functions, but the intent of the code is more
readable with them.
2021-10-11 17:33:57 +02:00
Wei Huang
b7d90ca991
sched: adjust events to register for VolumeBinding plugin 2021-10-07 08:51:04 -07:00
Kubernetes Prow Robot
6c292ce270
Merge pull request #105245 from yibozhuang/lost-pvc-prefilter-optimization
Scheduler volumebinding plugin - handle Lost PVC as UnschedulableAndUnresolvable
2021-10-05 08:23:09 -07:00
Kubernetes Prow Robot
04f747d09f
Merge pull request #104782 from kerthcet/cleanup/remove-cc-v1beta1
remove scheduler component config v1beta1
2021-10-04 08:53:08 -07:00
Kubernetes Prow Robot
e414cf7641
Merge pull request #100482 from pohly/generic-ephemeral-volume-checks
generic ephemeral volume checks
2021-10-01 10:47:22 -07:00
Patrick Ohly
1d181ad84f scheduler: fail the volume attach limit when PVC is missing
Previously, the situation was ignored, which might have had the effect that Pod
scheduling continued (?) even though the Pod+PVC weren't known to be in an
acceptable state.
2021-10-01 17:03:44 +02:00
Patrick Ohly
1e26115df5 consider ephemeral volumes for host path and node limits check
When adding the ephemeral volume feature, the special case for
PersistentVolumeClaim volume sources in kubelet's host path and node
limits checks was overlooked. An ephemeral volume source is another
way of referencing a claim and has to be treated the same way.
2021-10-01 17:03:44 +02:00
Yibo Zhuang
b8fe514232 Scheduler volumebinding plugin - handle Lost PVC as
UnschedulableAndUnresolvable

This change adds an additional check in the volumebinding scheduler
plugin to handle PVC with phase ClaimLost which will allow the
scheduler to return UnschedulableAndUnresolvable during the PreFilter
stage and skip the rest of the node evaluation since the PVC is
bound to a PV that does not exist.

Without this change, the FailedScheduling error message would look like:

0/10 nodes are available: 2 node(s) had taint {node/test: true},
that the pod didn't tolerate, 6 node(s) had taint {node/unhealthy: true},
that the pod didn't tolerate, 2 pvc(s) bound to non-existent pv(s)

Which is still evaluating every single node to determine that the pod
cannot be scheduled because the PVC is bound to a non-existent PV

With this change, the FailedScheduling error message would look like:

0/10 nodes are available: 1 persistentvolumeclaim "foo" bound
to non-existent persistentvolume "bar"

Signed-off By: Yibo Zhuang <yibzhuang@gmail.com>
2021-09-30 21:49:46 -07:00
kerthcet
75a255d2ed remove scheduler component config v1beta1
Signed-off-by: kerthcet <kerthcet@gmail.com>
2021-09-28 13:13:17 +08:00
Kubernetes Prow Robot
16fdb2f391
Merge pull request #105196 from yibozhuang/improve-scheduler-pv-not-exist-err
Enhance ErrReasonPVNotExist in volumebinding scheduler plugin
2021-09-27 19:04:42 -07:00
Yibo Zhuang
603a4e1931 Enhance ErrReasonPVNotExist in volumebinding scheduler plugin
This change will make the message more clear when there
is a case of PVC(s) bound to PV(s) that no longer exists
and scheduler does not select the node due to this issue.

Previous error message would look like:
0/2 nodes are available: 2 pvc(s) bound to non-existent pv(s)

Updated message looks like:
0/2 nodes are available: 2 node(s) unavailable due to one or more
pvc(s) bound to non-existent pv(s)

For larger clusters with many different reasons of nodes that
are not available, the current message can be very misleading for
users to think that there are many PVCs lost due to PVs deleted but
in fact it could be just a single PVC case but many nodes not selected
by the scheduler due to this case.

Signed-off By: Yibo Zhuang <yibzhuang@gmail.com>
2021-09-27 15:02:35 -07:00
Kubernetes Prow Robot
dca007bac8
Merge pull request #105212 from BinacsLee/binacs-scheduler-do-not-reference-range-loop-vars
scheduler: do not reference range-loop variable
2021-09-27 13:59:45 -07:00
Kubernetes Prow Robot
24408ef7f5
Merge pull request #104892 from zzchun/fix-typo-in-node_affinity_test
fix typo in node_affinity_test
2021-09-23 13:22:55 -07:00
BinacsLee
f6864316ef scheduler: do not reference range-loop variable 2021-09-23 21:59:30 +08:00
Wei Huang
3b64c1b01d
sched: de-duplicate plugin registration logic by using FactoryAdapter 2021-09-20 10:12:34 -07:00
Kubernetes Prow Robot
fb70ca9b7b
Merge pull request #105046 from alculquicondor/system-spreading
Skip check for all topology labels when using system default spreading
2021-09-16 11:36:14 -07:00
Aldo Culquicondor
609306dd5b Skip check for all topology labels when using system default spreading
Checking for all topology labels is not backwards compatible. Clusters were nodes don't have zone labels effectively have default spreading disabled.

Change only applies to system defaults.
2021-09-16 09:37:56 -04:00
Patrick Ohly
1d656d46a2 scheduler: avoid repeated boilerplate code when registering plugins
Some plugins expect the new feature gate struct. We can inject that additional
parameter via a helper function instead of having to repeat the same anonymous
function for each plugin.
2021-09-16 11:23:57 +02:00
Kubernetes Prow Robot
c6dfe7343e
Merge pull request #103493 from cofyc/fix103431
scheduler/volumebinding: migrate to use pkg/scheduler/framework/plugins/feature
2021-09-13 13:27:50 -07:00
Yecheng Fu
82b50dcb7b scheduler/volumebinding: migrate to use pkg/scheduler/framework/plugins/feature 2021-09-11 10:17:28 +08:00
Kubernetes Prow Robot
cf535b0339
Merge pull request #104866 from zzchun/fix-typo-in-framework-interface
fix typo in framework interface
2021-09-10 06:46:01 -07:00
zzchun
7c17672ae7 fix typo in node_affinity_test
Signed-off-by: zzchun <zzchun@zju.edu.cn>
2021-09-10 15:10:24 +08:00
zzchun
3ad158d62c fix typo in framework interface
Signed-off-by: zzchun <zzchun@zju.edu.cn>
2021-09-10 10:14:21 +08:00
Dave Chen
6e1835b83b Fix couple of incorrect description
Signed-off-by: Dave Chen <dave.chen@arm.com>
2021-09-08 10:08:23 +08:00
Kubernetes Prow Robot
b12379ef1c
Merge pull request #104605 from pohly/ephemeral-volume-events
scheduler: more informative generic ephemeral volume events
2021-09-03 17:51:19 -07:00
zc
b33897f36d modify non-uniform aliases 2021-08-31 09:07:51 +08:00
Kubernetes Prow Robot
7282c2002e
Merge pull request #99273 from yangjunmyfm192085/run-test20
Structured Logging migration:modify Scheduler part logs.
2021-08-30 05:56:54 -07:00
Patrick Ohly
89cb4d0ee9 scheduler: better reason for delay with generic ephemeral volumes
These events are currently emitted for a pod using a generic ephemeral volume:

  Type     Reason            Age   From               Message
  ----     ------            ----  ----               -------
  Warning  FailedScheduling  3s    default-scheduler  0/1 nodes are available: 1 persistentvolumeclaim "my-csi-app-inline-volume-my-csi-volume" not found.
  Warning  FailedScheduling  2s    default-scheduler  0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.

The one about "persistentvolumeclaim not found" is potentially confusing. It
occurs because the scheduler typically checks the pod before the ephemeral
volume controller had a chance to create the PVC.

This is a bit easier to understand:

  Type     Reason            Age   From               Message
  ----     ------            ----  ----               -------
  Warning  FailedScheduling  4s    default-scheduler  0/1 nodes are available: 1 waiting for ephemeral volume controller to create the persistentvolumeclaim "my-csi-app-inline-volume-my-csi-volume".
  Warning  FailedScheduling  2s    default-scheduler  0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.
2021-08-30 10:06:59 +02:00
JunYang
93047824f7 Structured Logging migration:modify Scheduler part logs.
Signed-off-by: JunYang <yang.jun22@zte.com.cn>
2021-08-29 20:17:08 +08:00
dntosas
cd795fa2eb
[scheduler] Remove deprecated volumeSchedulingLatency metric
As part of https://github.com/kubernetes/kubernetes/pull/100720 we
backported fix on existing releases and in this commit we completely
remove the deprecated metric from master branch.

Signed-off-by: dntosas <ntosas@gmail.com>
2021-08-23 15:18:16 +03:00
dntosas
7cbac6bde0 [volumeScheduling/metrics] Fix buckets initialization
This metrics is measured in seconds so it makes no sense starting from
1000 as init value. This breaks also the scheduler e2e metric thus make
users unable to compute, for example, their SLO for the scheduler.
Even if this metric is deprecated, it should behave correctly until it is
completely removed to avoid user confusion.

For example, for each volume created, the minimum value exposed
as a metric is 16.6min (1000sec/60) which is obviously wrong as logic.

In this commit, we migrate bucket creation to start from reasonable
numbers, copying the incrementation from the conventions that the
scheduler follows itself.

Signed-off-by: dntosas <ntosas@gmail.com>
2021-08-17 12:49:40 +03: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
Kubernetes Prow Robot
27b02a3e37
Merge pull request #104030 from chendave/refactoring_new
Refactor defaultpreemption for out-of-tree plugins
2021-08-11 18:38:00 -07:00
Dave Chen
3af26bae2c Refactor defaultpreemption for out-of-tree plugins
Signed-off-by: Dave Chen <dave.chen@arm.com>
2021-08-11 09:29:17 +08:00
Wei Huang
dc079acc2b
sched: retry unschedule pods immediately after a waiting pod's deletion 2021-08-06 19:08:37 -07:00
Kubernetes Prow Robot
3ee63b09b7
Merge pull request #103775 from jyz0309/optimze
Optimize the for range code in types.go
2021-08-04 22:12:53 -07:00
Kubernetes Prow Robot
33778cb2ba
Merge pull request #103757 from sanposhiho/fix/scheduler/framework/add-doc-on-status-reason
Add: specify that reason is a field to record the reason why failed
2021-08-04 22:12:46 -07:00
Kubernetes Prow Robot
b16f7e841d
Merge pull request #103686 from kerthcet/document/add_comment_for_enqueueExtensions
update comment with EnqueueExtensions
2021-08-04 22:11:48 -07:00
houjun
8dc091ef2e Fix wrong log 2021-07-26 11:38:02 +08:00
sanposhiho
6680368958 Add: specify that reason is a field to record the reason why failed 2021-07-20 20:33:40 +09:00
jyz0309
d05b232afc optimize the code
Signed-off-by: jyz0309 <45495947@qq.com>
2021-07-20 09:16:14 +08:00
kerthcet
d1e9da9f8a update comment with EnqueueExtensions
Signed-off-by: kerthcet <kerthcet@gmail.com>

update comment with EnqueueExtensions

Signed-off-by: kerthcet <kerthcet@gmail.com>

update comment with EnqueueExtensions

Signed-off-by: kerthcet <kerthcet@gmail.com>

update comment with EnqueueExtensions

Signed-off-by: kerthcet <kerthcet@gmail.com>
2021-07-16 09:56:26 +08:00
Wei Huang
fb9cafc99b
sched: provide an option for plugin developers to move pods to activeQ 2021-07-07 12:50:12 -07:00
Kubernetes Prow Robot
ea3bcbc205
Merge pull request #101946 from chendave/balance_allocation
Support extended resource in NodeResourcesBalancedAllocation plugin
2021-07-06 10:42:19 -07:00
Yecheng Fu
83ee392ed4 implement EnqueueExtensions interface in volumebinding 2021-07-03 08:25:06 +08:00
Kubernetes Prow Robot
25bbe2ebc5
Merge pull request #99594 from cofyc/kep1845-api
Prioritizing nodes based on volume capacity: API changes
2021-07-01 15:35:51 -07:00
Yecheng Fu
b522e95aae Prioritizing nodes based on volume capacity: API changes 2021-07-01 10:00:59 +08:00
Kubernetes Prow Robot
385402d506
Merge pull request #103082 from chrishenzie/read-write-once-pod-access-mode-scheduler
Enforce ReadWriteOncePod during scheduling
2021-06-30 16:11:36 -07:00
Chris Henzie
7ad44d04fc Enforce ReadWriteOncePod access mode during scheduling
Check the PVC ref count on the node info cache to determine if a pod's
PVCs are in use. If they are and it is using ReadWriteOncePod, fail the
request.
2021-06-30 10:40:14 -07:00
Dave Chen
1fa673c15c Extent the NodeResourcesBalancedAllocation plugin to cover more resources
Signed-off-by: Dave Chen <dave.chen@arm.com>
2021-06-30 11:15:12 +08:00
Kubernetes Prow Robot
e0f66be1aa
Merge pull request #101822 from yuzhiquan/NodeResourcesFit-score
Add score func for NodeResourcesFit plugin
2021-06-29 13:42:20 -07:00
yuzhiquan
deb14b995a Add score plugin for NodeResourcesFit 2021-06-29 13:16:55 -04:00
Chris Henzie
ebc3fdb293 Store PVC reference counts in NodeInfo cache
This map will be queried as part of enforcement of the ReadWriteOncePod
access mode for PVCs
2021-06-29 10:07:32 -07:00
Wei Huang
20f84b12a1
Optimize scheduler res scorer on non-requested extended res 2021-06-25 11:41:36 -07:00
Kubernetes Prow Robot
72fc6d9ea0
Merge pull request #103089 from chendave/ratio_cleanup
Simplify the formula used in the `RequestedToCapacityRatio` plugin
2021-06-22 12:00:23 -07:00
ravisantoshgudimetla
b6c75bee15 Remove balanced attached node volumes
kubernetes#60525 introduced
Balanced attached node volumes feature gate to include volume
count for prioritizing nodes. The reason for introducing this
flag was its usefulness in Red Hat OpenShift Online environment
which is not being used any more. So, removing the flag
as it helps in maintainability of the scheduler code base
as mentioned at kubernetes#101489 (comment)
2021-06-22 11:19:30 -04:00
Dave Chen
0f922b200f Simplify the formula used in the RequestedToCapacityRatio plugin
Signed-off-by: Dave Chen <dave.chen@arm.com>
2021-06-22 17:11:26 +08:00
Kubernetes Prow Robot
f899bbe445
Merge pull request #102925 from alculquicondor/fix-node-resources
Fix Node Resources plugins score when there are pods with no requests
2021-06-18 07:20:06 -07:00
Aldo Culquicondor
63d1237102 Fix Node Resources plugins score when there are pods with no requests
Given that we give a default CPU/memory requests for containers that don't provide any, the calculated usage can exceed the allocatable.

Change-Id: I72e249652acacfbe8cea0dd6f895dabe43ff6376
2021-06-16 20:36:07 +00: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
Abdullah Gharaibeh
46f3e4dfdd Define in-tree scheduler plugin names in separate pkg to break a cyclic depednecy when moving plugin defaulting to CC 2021-06-09 15:36:09 -04:00
Kubernetes Prow Robot
6cb421487a
Merge pull request #99597 from adtac/v1b2
scheduler CC: add v1beta2 API, deprecate plugins
2021-06-08 12:26:08 -07: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
Kubernetes Prow Robot
2e6e8857d1
Merge pull request #102518 from chendave/cleanup_constat
Cleanup redundant failure reason in InterPodAffinity plugin
2021-06-02 09:46:34 -07:00
Kubernetes Prow Robot
a9725892b7
Merge pull request #102485 from alculquicondor/cleanup_interface
Cleanup Framework interface
2021-06-01 23:12:32 -07:00
Dave Chen
b049e1b9ab Cleanup redundant failure reason in InterPodAffinity plugin
Both `ErrReasonAffinityRulesNotMatch` and `ErrReasonAntiAffinityRulesNotMatch` are
more precise than `ErrReasonAffinityNotMatch`.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2021-06-02 11:52:55 +08:00
Aldo Culquicondor
673352dbd2 Cleanup Framework interface
remove repeated methods
2021-06-01 20:43:32 +00:00
Abdullah Gharaibeh
4567a43101 Return UnschedulableAndUnresolvable when looking up volume-related resources returns NotFound error 2021-06-01 09:19:04 -04:00
Kubernetes Prow Robot
ae1f28d7b0
Merge pull request #102306 from ahg-g/ahg-vol-restrictions
Return UnschedulableAndUnresolvable instead of Error when failing to lookup volume-related resources
2021-05-27 20:48:25 -07:00
Kubernetes Prow Robot
2da8d1c18f
Merge pull request #102234 from sanposhiho/scheduler/add/interface-check-on-nodeaffinity
scheduler/add: interface check on nodeaffinity
2021-05-26 03:17:32 -07:00
Kubernetes Prow Robot
aa0017ad13
Merge pull request #102236 from ahg-g/ahg-spread
Use ownerReference to build default spreading constraints
2021-05-25 19:39:28 -07:00
Abdullah Gharaibeh
17551f291d Return UnschedulableAndUnresolvable instead of Error when failing to lookup pvc or storageclass in VolumeZone plugin 2021-05-25 18:58:11 -04:00
Abdullah Gharaibeh
6c0976814c use ownerReference to build default spreading contraints in the scheduler 2021-05-25 16:04:48 -04:00
Davanum Srinivas
383ce85649
[scheduler] avoid comparing function pointers in unit tests
PluginFactory is a function that returns a plugin. We have been
comparing these functions in unit tests and it has worked so far, but
starts to fail in gotip/master.

Note from the golang team:
```
Func values are incomparable. It is true that you could get the PC
through reflection but it is still not expected to be compared. PCs
can change due to inlining, wrappers, etc., depending on the
compiler's details, which is subject to change.
```

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2021-05-25 09:34:54 -04:00
sanposhiho
1b6895c11f Fix: remove framework.ScoreExtensions interface check 2021-05-25 13:57:30 +09:00
Kubernetes Prow Robot
4509d6f79f
Merge pull request #101460 from edwardstudy/ed/fix-score-weight
Introduce scorePluginWeightMap to replace pluginNameToWeightMap
2021-05-24 21:48:56 -07:00
Kubernetes Prow Robot
5cdf7a714f
Merge pull request #100026 from minbaev/enqueue-extions-to-nvl
add enqueue-extensions nodevolumelimits plugin
2021-05-24 21:48:20 -07:00
Alexander Minbaev
3b4be144ab add enqueue-extensions nodevolumelimits plugin 2021-05-24 16:59:31 -05:00
sanposhiho
517feed45b Add: interface check 2021-05-23 23:48:42 +09:00
sanposhiho
be16b7f818 Fix: Logging causes nilpointer 2021-05-23 23:17:29 +09:00
Mike Dame
5a77ebe28b Scheduler: remove pkg/features dependency from NodeResources plugins 2021-05-18 08:59:02 -04:00
edwardstudy
47785131e2 Introduce scorePluginWeightMap to replace pluginNameToWeightMap 2021-05-11 10:23:29 +08:00
yuzhiquan
2b6af46624 fix potential panic for node resource plugin 2021-05-08 18:03:24 +08:00
houjun
447e55132a Delete duplicate judgments 2021-05-07 22:44:41 +08:00
Kubernetes Prow Robot
43e3669482
Merge pull request #101757 from pacoxu/test-fix-registry
compare the func with .Pointer() in scheduler registry-test
2021-05-06 20:59:03 -07:00
Kubernetes Prow Robot
d5691f754f
Merge pull request #101703 from july2993/read
use '_' in nodelabel plugin for unused parameters
2021-05-06 05:15:16 -07:00
pacoxu
be0f192acd compare the func with .Pointer() in scheduler registry-test
Signed-off-by: pacoxu <paco.xu@daocloud.io>
2021-05-06 18:49:04 +08:00
Wei Huang
9c45e8a974
sched: make CycleState's Read()/Write()/Delete() thread-safe
- add internal locking to CycleState's Read()/Write()/Delete() functions
- remove Lock() and Unlock() functions
2021-05-05 12:00:52 -07:00
Yuan Chen
fce28dbac9 Prevent scheduler crashing in default preemption 2021-05-04 19:30:11 -07:00
Jiahao Huang
0980b33b0e use '_' in nodelabel plugin for unused parameters 2021-05-03 18:06:02 +08:00
Konstantin Misyutin
74e30c5e38 Scheduler: remove pkg/features dependency from DefaultPreemption plugin
Signed-off-by: Konstantin Misyutin <konstantin.misyutin@huawei.com>
2021-04-29 23:12:46 +08:00
Kubernetes Prow Robot
b4ea4322a6
Merge pull request #101467 from ingvagabund/noderesources-replace-IsScalerResourceName-with-nodeinfo-allocatable-scalar-resource-presence
noderesource: node info already knows which resources are scalar
2021-04-28 18:12:50 -07:00
Jan Chaloupka
7286f9712a pkg/scheduler: drop Resource.ResourceList() method
The method is used only for testing purposes. Given Resource data type
exposes all its fields, any invoker of ResourceList that is still
using the method outside of kubernetes/kubernetes can still either
copy paste the original implementation or implement a custom method
that's converting resources into proper Quantity data type.

Given the hugepage resource is a scalar resource, it's sufficient
the underlying code under fit_test.go to take into account any
extended resources. For predicate_test.go, the hugepage
resource does not play any role as the General predicates test cases
does not set any scaler resource at all.

Additionally, by removing ResourceList method, pkg/scheduler/framework
can get rid of dependency on k8s.io/kubernetes/pkg/apis/core/v1/helper.
2021-04-28 16:26:33 +02:00
Jan Chaloupka
11d6576f83 noderesource: node info already knows which resources are scalar
NodeInfo.Allocatable.ScalarResources already knows which resources
are scaler. Also, if the resource name is not present,
it's pointless to compute score for a resources the node can not allocate
since nodeInfo.Allocatable.ScalarResources[resource] is zero for the case.
And both leastRequestedScore and mostRequestedScore returns 0 score
for nodes with zero allocatable resource.
The balancedResourceScorer deals only with CPU and memory which
are not scalable resources.
2021-04-25 23:32:03 +02:00
Kubernetes Prow Robot
a160d1dedc
Merge pull request #101297 from houjun41544/20210421-volumezone
Remove redundant checks
2021-04-21 19:15:56 -07:00
Kubernetes Prow Robot
75b846dee4
Merge pull request #101313 from BinacsLee/binacs-scheduler-fwk-types-cleanup
code cleanup: scheduler / framework use `max` function instead of if-cond…
2021-04-21 17:04:13 -07:00
Kubernetes Prow Robot
5779fec3c4
Merge pull request #99959 from AliceZhang2016/nodeaffinity-cleanup
Move nodeaffinity helpers to component-helpers package
2021-04-21 17:03:53 -07:00
Kubernetes Prow Robot
ba5ec40d41
Merge pull request #101277 from wangyx1992/capatial-log-scheduler
cleanup: fix log capitalization in scheduler
2021-04-21 12:20:03 -07:00
BinacsLee
9ff1419511 code cleanup: scheduler simplify the check function in NodeLabel.Filter 2021-04-21 20:30:02 +08:00
BinacsLee
8f57233a3a code cleanup: scheduler/framework use max function instead of if-condition in types.go 2021-04-21 17:40:35 +08:00
houjun
d3a355d6dc Remove redundant checks 2021-04-21 09:55:45 +08:00
wangyx1992
97c4a4ffa5 cleanup: fix log capitalization in scheduler
Signed-off-by: wangyx1992 <wang.yixiang@zte.com.cn>
2021-04-20 20:20:02 +08:00
BinacsLee
c1fd8390e5 code cleanup: pkg/scheduler modify framework/types.go 2021-04-20 20:07:43 +08:00
Kubernetes Prow Robot
a95fd40203
Merge pull request #100322 from minbaev/cluster-event-reg-cleanup
got rid of ClusterEventReg generate ClusterEvent objects on the fly
2021-04-14 21:27:49 -07:00
Kubernetes Prow Robot
6d130d3b97
Merge pull request #100557 from chendave/validation_cleanup
Validate plugin config for KubeSchedulerConfiguration
2021-04-14 18:20:01 -07:00
Kubernetes Prow Robot
74763cd7e8
Merge pull request #100370 from houjun41544/20210318-nodeinfoIsNil
Remove redundant checks
2021-04-14 18:19:49 -07:00
Kubernetes Prow Robot
d09d1ea6cb
Merge pull request #100853 from yuzhiquan/scheduler-events
Implement EnqueueExtensions interface in TopologySpreading scheduling
2021-04-14 13:15:10 -07:00
Kubernetes Prow Robot
e42f44588a
Merge pull request #100090 from whypro/enqueue-extension
Implement EnqueueExtensions interface in volumerestrictions and volumezone.
2021-04-14 11:57:09 -07:00
Alexander Minbaev
8325c6b0da got rid of ClusterEventReg with generating ClusterEvent objects on the fly 2021-04-14 13:38:46 -05:00
Dave Chen
c6e65079c7 Validate plugin config for KubeSchedulerConfiguration
Signed-off-by: Dave Chen <dave.chen@arm.com>
2021-04-14 09:30:20 +08:00
Dave Chen
62d7f8f570 Fix couple of nits in nodevolumelimits plugin
Signed-off-by: Dave Chen <dave.chen@arm.com>
2021-04-13 15:59:50 +08:00
Kubernetes Prow Robot
1fa101d1a4
Merge pull request #100947 from lojies/cleanuppkgsheduler
code cleanup for pkg/scheduler
2021-04-13 00:44:50 -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
卢振兴10069964
5ddb1be59a code cleanup for pkg/scheduler 2021-04-13 08:16:16 +08:00
whypro
641627980b Implement EnqueueExtensions interface in volumerestrictions and volumezone. 2021-04-10 00:17:57 +08:00
Kubernetes Prow Robot
4959cd6339
Merge pull request #100671 from Niekvdplas/spelling-mistakes
Fixed several spelling mistakes
2021-04-09 05:19:45 -07:00
Kubernetes Prow Robot
c0778c7e9a
Merge pull request #100479 from houjun41544/20210323-InterPodAffinity
Missing return when error
2021-04-08 22:10:05 -07:00
Kubernetes Prow Robot
ad84094a8f
Merge pull request #100477 from chendave/validation_noderesource
Move NodeResourcesFit plugin args validation to apis/config/validation
2021-04-08 22:09:56 -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
Kubernetes Prow Robot
3c75651d15
Merge pull request #100357 from Huang-Wei/enq-serviceaffinity
implement EnqueueExtensions interface in serviceaffinity
2021-04-08 20:30:20 -07:00
Kubernetes Prow Robot
4b9421674f
Merge pull request #100325 from cwdsuzhou/donot_delete_waitingpod
Preempting: do not delete the victim if it just exits in WaitingPods
2021-04-08 20:29:46 -07:00
Kubernetes Prow Robot
227db2e0d4
Merge pull request #100279 from Jerry-Ge/nodename
added eventsToRegister for nodeName & nodeUnschedulable plugins
2021-04-08 20:29:21 -07:00
Kubernetes Prow Robot
2b89558a1f
Merge pull request #100051 from tanjing2020/nodeaffinity
implement EnqueueExtensions interface in nodeaffinity
2021-04-08 17:11:13 -07:00
Kubernetes Prow Robot
7cd73076a2
Merge pull request #100049 from Huang-Wei/basic-check-prior-to-enq
sched: support PreEnqueueChecks prior to moving Pods
2021-04-08 17:11:04 -07:00
Kubernetes Prow Robot
2159f967b4
Merge pull request #100020 from pravarag/interpodaffinity-schedule-plugin
implement EnqueueExtensions in interPodAffinity
2021-04-08 17:10:38 -07:00
Kubernetes Prow Robot
d0510aae37
Merge pull request #100004 from KofClubs/implement-EventsToRegister-nodeports
Implemented EnqueueExtensions interface for NodePorts
2021-04-08 17:10:30 -07:00
Kubernetes Prow Robot
10ed4502f4
Merge pull request #99937 from wzshiming/fea/enq-nodelabel
Implement EnqueueExtensions interface in nodelabel
2021-04-08 16:00:51 -07:00
Kubernetes Prow Robot
adbf279bf1
Merge pull request #99936 from pacoxu/feature/taint-schedule-plugin
implement EnqueueExtensions interface in taint toleration scheduling
2021-04-08 16:00:43 -07:00
yuzhiquan
76b68a19d7 implement register events for PodTopologySpread 2021-04-08 09:14:34 +08:00
Pravar Agrawal
2cf284994f implement EnqueueExtensions in interPodAffinity 2021-04-07 08:43:49 +05:30
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
houjun
d9939a34d9 Missing return on error 2021-03-23 17:21:07 +08:00
Dave Chen
a0d93cc0c8 Move NodeResourcesFit plugin args validation to apis/config/validation
Signed-off-by: Dave Chen <dave.chen@arm.com>
2021-03-23 16:09:53 +08:00
caiweidong
850759ec87 Preempting: do not delete the victim if it just exits in WaitingPods 2021-03-23 14:37:36 +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
Wei Huang
9d1ef9f4c5
unregister Service events if a plugin doesn't implement EventsToRegister() 2021-03-18 11:04:06 -07:00
houjun
4c6d5ea709 Remove redundant checks 2021-03-18 19:52:39 +08:00
Jerry.Ge
31b79f481e added eventsToRegister for nodeName & nodeUnschedulable plugins
Signed-off-by: Jerry Ge <jerry.ge@arm.com>
2021-03-18 04:22:51 -04:00
Wei Huang
ed673ba0e9
implement EnqueueExtensions interface in serviceaffinity 2021-03-17 19:04:08 -07:00
Zhang Zhanpeng
2678f26944 Implemented function EventsToRegister for NodePorts
Signed-off-by: Zhang Zhanpeng <zhanpeng.zhang@daocloud.io>

Added pod deletion event

Signed-off-by: Zhang Zhanpeng <zhanpeng.zhang@daocloud.io>

Deleted node condition update event & added service deletion

Signed-off-by: Zhang Zhanpeng <zhanpeng.zhang@daocloud.io>

Implemented function EventsToRegister for NodePorts

Signed-off-by: Zhang Zhanpeng <zhanpeng.zhang@daocloud.io>

Deleted service deletion

Signed-off-by: Zhang Zhanpeng <zhanpeng.zhang@daocloud.io>

Added a comment to explain why not registering pod update events
2021-03-17 14:42:13 +08:00
Wei Huang
6384f397b4
sched: support PreEnqueueChecks prior to moving Pods 2021-03-11 12:31:50 -08:00
Mengxue Zhang
bdda9728e7 move nodeaffinity helpers to component-helpers package 2021-03-10 20:19:25 +00:00
tanjing2020
cd6bf47a19 implement EnqueueExtensions interface in nodeaffinity 2021-03-10 19:22:08 +08:00
Kubernetes Prow Robot
f17004981b
Merge pull request #100034 from AliceZhang2016/nodeaffinity-cleanup-only-scheduler
move nodeaffinity helpers to component-helpers package (only impact s…
2021-03-09 17:39:56 -08:00
Mengxue Zhang
fd8128d7d6 move nodeaffinity helpers to component-helpers package (only impact scheduler plugins) 2021-03-09 21:33:02 +00:00
Kubernetes Prow Robot
2bcbc527a7
Merge pull request #99995 from wzshiming/fix/scheduler-nodelabel
Scheduler/plugins/nodelabel fix no label preference
2021-03-09 12:23:04 -08:00
Kubernetes Prow Robot
d256468a09
Merge pull request #99644 from gavinfish/sched-param
Scheduler: make parallelism as part of schedulerOptions
2021-03-09 11:05:42 -08:00
Kubernetes Prow Robot
046ad61479
Merge pull request #99290 from mortent/PromotePDBsToGA
Promote PodDisruptionBudget to policy/v1
2021-03-09 11:05:05 -08:00
Kubernetes Prow Robot
17395678c4
Merge pull request #99671 from tanjing2020/scheduler-policy
Log invalid scheduler-policy input instead of panic
2021-03-09 09:19:26 -08:00
Shiming Zhang
ab3a765570 Scheduler/plugins/nodelabel fix no label preference 2021-03-10 00:19:28 +08:00
Morten Torkildsen
21fba79d45 Promote PDBs to GA 2021-03-09 10:29:11 -05:00
drfish
c2ceb21a3e Make parallelism as part of schedulerOptions 2021-03-09 23:25:55 +08:00
Kubernetes Prow Robot
7c57489f84
Merge pull request #99297 from chendave/testonly
Move test specific option setting to the test file
2021-03-09 06:35:00 -08:00
tanjing2020
2d79ebbe58 Log invalid scheduler-policy input instead of panic 2021-03-09 15:21:46 +08:00
pacoxu
09298dd83f implement EnqueueExtensions interface in taint toleration scheduling
Signed-off-by: pacoxu <paco.xu@daocloud.io>
Co-authored-by: Wei Huang <weih@hey.com>
2021-03-09 12:21:00 +08:00
Shiming Zhang
6907b915f5 implement EnqueueExtensions interface in nodelabel 2021-03-09 10:32:57 +08:00
Dave Chen
20cad3b5da Move test specific option setting to the test file
Setting of "metricsRecorder" is only needed for testcase.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2021-03-09 10:30:22 +08:00
Wei Huang
e86a72add7
implement EnqueueExtensions interface in noderesources 2021-03-08 15:24:05 -08:00
Kubernetes Prow Robot
14c25eed8d
Merge pull request #99641 from pohly/storage-capacity-beta
CSIStorageCapacity beta API
2021-03-08 15:04:59 -08:00
Kubernetes Prow Robot
2b3f97b08f
Merge pull request #99389 from tanjing2020/change-log
Use %w instead of %v to format errors
2021-03-08 12:07:12 -08:00
Patrick Ohly
5ca0814165 CSIStorageCapacity: use beta API 2021-03-08 20:52:50 +01:00
Kubernetes Prow Robot
027d9e6c25
Merge pull request #99835 from chendave/args
Move VolumeBinding plugin args validation to apis/config/validation
2021-03-08 09:31:42 -08:00
tanjing2020
61cd099bc1 Use %w instead of %v to format errors 2021-03-08 10:23:08 +08:00