Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
bc2845ee
Commit
bc2845ee
authored
Oct 30, 2017
by
Stewart-YU
Committed by
stewart-yu
Oct 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add explain for preempt sunction.
parent
e5c732ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
scheduler.go
plugin/pkg/scheduler/scheduler.go
+3
-0
No files found.
plugin/pkg/scheduler/scheduler.go
View file @
bc2845ee
...
...
@@ -184,6 +184,9 @@ func (sched *Scheduler) schedule(pod *v1.Pod) (string, error) {
return
host
,
err
}
// preempt tries to create room for a pod that has failed to schedule, by preempting lower priority pods if possible.
// If it succeeds, it adds the name of the node where preemption has happened to the pod annotations.
// It returns the node name and an error if any.
func
(
sched
*
Scheduler
)
preempt
(
preemptor
*
v1
.
Pod
,
scheduleErr
error
)
(
string
,
error
)
{
if
!
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
PodPriority
)
{
glog
.
V
(
3
)
.
Infof
(
"Pod priority feature is not enabled. No preemption is performed."
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment