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
f1d98ba9
Commit
f1d98ba9
authored
Jun 10, 2016
by
xiangpengzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make priority score info more clear
parent
60c1ec8e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
priorities.go
plugin/pkg/scheduler/algorithm/priorities/priorities.go
+4
-4
taint_toleration.go
...in/pkg/scheduler/algorithm/priorities/taint_toleration.go
+3
-0
No files found.
plugin/pkg/scheduler/algorithm/priorities/priorities.go
View file @
f1d98ba9
...
...
@@ -61,10 +61,10 @@ func calculateResourceOccupancy(pod *api.Pod, node api.Node, nodeInfo *scheduler
cpuScore
:=
calculateScore
(
totalMilliCPU
,
capacityMilliCPU
,
node
.
Name
)
memoryScore
:=
calculateScore
(
totalMemory
,
capacityMemory
,
node
.
Name
)
glog
.
V
(
10
)
.
Infof
(
"%v -> %v: Least Requested Priority,
Absolute/Requested: (%d, %d) / (%d, %d) Score: (%d, %d)
"
,
"%v -> %v: Least Requested Priority,
capacity %d millicores %d memory bytes, total request %d millicores %d memory bytes, score %d CPU %d memory
"
,
pod
.
Name
,
node
.
Name
,
totalMilliCPU
,
totalMemory
,
capacityMilliCPU
,
capacityMemory
,
totalMilliCPU
,
totalMemory
,
cpuScore
,
memoryScore
,
)
...
...
@@ -254,10 +254,10 @@ func calculateBalancedResourceAllocation(pod *api.Pod, node api.Node, nodeInfo *
score
=
int
(
10
-
diff
*
10
)
}
glog
.
V
(
10
)
.
Infof
(
"%v -> %v: Balanced Resource Allocation,
Absolute/Requested: (%d, %d) / (%d, %d) Score: (%d)
"
,
"%v -> %v: Balanced Resource Allocation,
capacity %d millicores %d memory bytes, total request %d millicores %d memory bytes, score %d
"
,
pod
.
Name
,
node
.
Name
,
totalMilliCPU
,
totalMemory
,
capacityMilliCPU
,
capacityMemory
,
totalMilliCPU
,
totalMemory
,
score
,
)
...
...
plugin/pkg/scheduler/algorithm/priorities/taint_toleration.go
View file @
f1d98ba9
...
...
@@ -17,6 +17,7 @@ limitations under the License.
package
priorities
import
(
"github.com/golang/glog"
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/plugin/pkg/scheduler/algorithm"
schedulerapi
"k8s.io/kubernetes/plugin/pkg/scheduler/api"
...
...
@@ -104,6 +105,8 @@ func (s *TaintToleration) ComputeTaintTolerationPriority(pod *api.Pod, nodeNameT
if
maxCount
>
0
{
fScore
=
(
1.0
-
float64
(
counts
[
node
.
Name
])
/
float64
(
maxCount
))
*
10
}
glog
.
V
(
10
)
.
Infof
(
"%v -> %v: Taint Toleration Priority, Score: (%d)"
,
pod
.
Name
,
node
.
Name
,
int
(
fScore
))
result
=
append
(
result
,
schedulerapi
.
HostPriority
{
Host
:
node
.
Name
,
Score
:
int
(
fScore
)})
}
return
result
,
nil
...
...
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