Commit Graph

34 Commits

Author SHA1 Message Date
kidddddddddddddddddddddd
059d520537 return skip 2023-01-07 21:58:54 +08:00
kidddddddddddddddddddddd
27c5c0a16d pv_list to prefilter 2022-12-22 14:59:41 +08:00
Yibo Zhuang
380c7f248e scheduler volumebinding: leverage PreFilterResult
This change will leverage the new PreFilterResult
to reduce down the list of eligible nodes for pod
using Bound Local PVs during PreFilter stage so
that only the node(s) which local PV node affinity
matches will be cosnidered in subsequent scheduling
stages.

Today, the NodeAffinity check is done during Filter
which means all nodes will be considered even though
there may be a large number of nodes that are not
eligible due to not matching the pod's bound local
PV(s)' node affinity requirement. Here we can
reduce down the node list in PreFilter to ensure that
during Filter we are only considering the reduced
list and thus can provide a more clear message to
users when node(s) are not available for scheduling
since the list only contains relevant nodes.

If error is encountered (e.g. PV cache read error) or
if node list reduction cannot be done (e.g. pod uses
no local PVs), then we will still proceed to consider
all nodes for the rest of scheduling stages.

Signed-off-by: Yibo Zhuang <yibzhuang@gmail.com>
2022-11-17 21:37:24 -08:00
Kubernetes Prow Robot
7424098eaf
Merge pull request #109945 from bells17/fix-error-message
Fix error message
2022-08-23 16:04:26 -07:00
bells17
e539e04103 Use stretchr/testify/assert 2022-08-05 00:54:19 +09:00
Wojciech Tyczyński
7060953b92 Clear shutdown of scheduler metrics recorder 2022-05-20 20:23:29 +02:00
bells17
4477be81e7 Fix error message
Update pkg/scheduler/framework/plugins/volumebinding/volume_binding_test.go

Oh...thanks.

Co-authored-by: Kensei Nakada <handbomusic@gmail.com>
2022-05-13 23:56:38 +09:00
Abdullah Gharaibeh
5b20b68bc9 Updated the scheduler framework's PreFilter interface to return a PreFilterResult 2022-03-14 15:36:52 -04: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
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
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
Yecheng Fu
82b50dcb7b scheduler/volumebinding: migrate to use pkg/scheduler/framework/plugins/feature 2021-09-11 10:17:28 +08: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
Yecheng Fu
b522e95aae Prioritizing nodes based on volume capacity: API changes 2021-07-01 10:00:59 +08:00
Kubernetes Prow Robot
699b38669f
Merge pull request #99731 from AliceZhang2016/newFramework-accept-KubeSchedulerProfile
Make runtime.NewFramework accept KubeSchedulerProfile
2021-03-06 12:49:48 -08:00
Mengxue Zhang
b38caa91cc make runtime.NewFramework accept KubeSchedulerProfile 2021-03-05 18:30:21 +00:00
Yecheng Fu
d791f7feef Prioritizing nodes based on volume capacity: unit tests 2021-03-05 23:59:25 +08:00
Yecheng Fu
0961891a7a report UnschedulableAndUnresolvable status instead of an error when PVCs can't find bound
persistent volumes

This is an user error. We should't report an error.
2020-11-05 10:28:40 +08:00
Ali
09b2e8f638 Move scheduler interface to pkg/scheduler/framework 2020-10-13 13:13:27 +11:00
Wei Huang
185ba08fcd
Move podPassesBasicChecks() to VolumeBinding plugin 2020-09-11 13:54:02 -07:00
Yecheng Fu
96d0408a89 fix TestVolumeBinding unit test 2020-08-03 07:06:06 +08:00
Yecheng Fu
4627b419b4 tests only 2020-06-23 22:18:33 +08:00
Ali Farah
a22e115a0e Split scheduler framework implementation into new runtime package 2020-06-22 00:23:43 +10:00
Yecheng Fu
814a6f2acd remove FakeVolumeBinderConfig and test new statues and states 2020-06-12 10:00:19 +08: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
Yecheng Fu
c14b749521 scheduler/volumebinding: move all volume binding logic into VolumeBinding plugin 2020-05-12 10:13:05 +08: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
Haosdent Huang
50d511d4b8 Deprecate scheduler's framework.plugins.RegistryArgs 2020-01-21 23:50:58 +08:00
Haosdent Huang
d27dc6751e Break volumebinding Filter plugins dependency on predicates package 2020-01-05 01:37:22 +08:00
zouyee
83408acf75 Move volumebinding predicate to its filter plugin
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
2019-12-23 21:57:49 +08:00