Commit Graph

27 Commits

Author SHA1 Message Date
Deepak Nair
49a9e28dd8 Substitute boolean maps with String sets 2021-02-18 20:59:32 -08:00
Kubernetes Prow Robot
4e72a35b35
Merge pull request #98588 from gavinfish/sched-fw-ut
Scheduler: organize framework unit tests in subtests
2021-02-01 20:40:36 -08:00
Dave Chen
fe5a266a03 Include UnschedulableAndUnresolvable nodes into the status map
Signed-off-by: Dave Chen <dave.chen@arm.com>
2021-02-01 10:49:43 +08:00
drfish
0c3d8b9720 Organize framework unit tests in subtests 2021-01-31 13:34:52 +08:00
Dave Chen
9d48a44601 Expose node status so that external preemption plugins can use it
Signed-off-by: Dave Chen <dave.chen@arm.com>
2021-01-29 10:17:25 +08:00
drfish
8be6d9650c Update potentialVictims as framework.PodInfo type 2021-01-24 22:17:28 +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
drfish
070773c399 Remove scheduler plugins package's dependency from core package 2020-12-20 00:18:40 +08:00
Aldo Culquicondor
3ce145787a Add AddedAffinity to the NodeAffinityArgs
And use it in Filter and Score.

Change-Id: I173d8f2d5578762e9873181d5b44ea30b6dbbbc2
2020-11-09 15:19:15 -05:00
Adhityaa Chandrasekar
a3d94b53ca optimise defaultpreemption: enumerate fewer candidates
Signed-off-by: Adhityaa Chandrasekar <adtac@google.com>
2020-11-04 22:39:58 +00:00
Aldo Culquicondor
87c8349bdc Graduate DefaultPodTopologySpread to beta
And set to enabled by default

Change-Id: Ie4cc4758c52492924cb0663450f2747908cb5882
2020-10-19 16:58:09 -04:00
Ali
09b2e8f638 Move scheduler interface to pkg/scheduler/framework 2020-10-13 13:13:27 +11:00
Wei Huang
4f7ae54f3e
fixup: add podLister as a member field of DefaultPreemption 2020-09-08 18:27:23 -07:00
Wei Huang
52bf6ba8ba
Preemption plugin to fetch pod from informer cache 2020-09-08 18:27:23 -07:00
Kubernetes Prow Robot
72350a3cf7
Merge pull request #93083 from Huang-Wei/dupe-import-alias
Remove duplicate path imports
2020-08-28 04:34:53 -07:00
Kubernetes Prow Robot
a4103dfeaf
Merge pull request #92819 from chendave/cleanup_machine
Change the node name from "machine" to "node"
2020-08-27 19:06:57 -07:00
Wei Huang
bc04d73330
remove duplicate path import 2020-07-14 16:34:09 -07:00
Wei Huang
4e8ccf0187
Refactor and expose common preemption functions 2020-07-11 23:17:21 -07:00
Kubernetes Prow Robot
d06ff65943
Merge pull request #92876 from Huang-Wei/pdbLister
Add pdbLister as a member field of struct DefaultPreemption
2020-07-11 20:57:42 -07:00
Dave Chen
a1b2a7765d Change the node name from "machine" to "node"
Latest change on master rename the node name from "machine" to "node"
but haven't update all the affected code, which causes some of testcases
invalid.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2020-07-10 10:17:58 +08:00
Wei Huang
9d377eb655
Add pdbLister as a member field of struct DefaultPreemption 2020-07-07 12:25:53 -07:00
Dave Chen
028af0970f Cut off the cost to run filter plugins when no victim pods are found
If no potential victims could be found, there is no need to evaluate the node
again, since its state didn't change.

It's safe to return and thus prevent scheduling from running the filter plugins
again.

NOTE:
A node that is filtered out by filter plugins could pass the filter plugins if
there is a change on that node, i.e. pods termination on that node.

Previously, this could be either caught by the normal `schedule` or `preempt` (pods
are terminated when the preemption logic tries to find the nodes and re-evaluate
the filter plugins.)

Actually, this shouldn't be taken care by the preemption, consider the routine
of `schedule` is always running when the interval is "zero", let `schedule`
take care of it will release `preempt` from something irrelevant with the `preemption`.

Due to above reason, couple of testcase as well as the logic of checking the existence
of victim pods are removed as it will never happen after the change.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2020-07-07 09:55:34 +08:00
Kubernetes Prow Robot
19883b50f8
Merge pull request #92604 from soulxu/fix_preemption_with_nominated_node
The Pod is eligible to preempt when previous nominanted node is UnschedulableAndUnresolvable
2020-07-03 05:03:01 -07:00
Dave Chen
3e65fe4378 Change the exception to avoid the cost of preemption
node's labels doesn't contain the required topologyKeys in `Constraints`
cannot be resolved by preempting the pods on that pods.

One use case that could easily reproduce the issue is,
- set `alwaysCheckAllPredicates` to true.
- one node contains all the required topologyKeys but is failed in predicates
  such as 'taint'.
- another node doesn't hold all the required topologyKeys, and thus return `Unschedulable`
  status code.
- scheduler will try to preempt the pods on the above node with lower priorities.

Signed-off-by: Dave Chen <dave.chen@arm.com>
2020-07-03 10:17:31 +08:00
He Jie Xu
b3741f344e The Pod is eligible to preempt when previous nominanted node is UnschedulableAndUnresolvable
If the Pod's previous nominated node is UnschedulableAndUnresolvable from previous
filtering, it should be considered for preemption again.
2020-07-03 08:57:45 +08:00
Wei Huang
7362fccdd7
Polish unit tests of defaultpreemptio plugin 2020-06-30 14:05:48 -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