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
4e39800b
Commit
4e39800b
authored
Aug 20, 2016
by
Kubernetes Submit Queue
Committed by
GitHub
Aug 20, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #30992 from mwielgus/cluster-autoscaler-alg
Automatic merge from submit-queue Cluster autoscaler friendly scheduling algorithm cc: @davidopp
parents
ada58f5f
2df92ff1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
defaults.go
plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go
+14
-1
No files found.
plugin/pkg/scheduler/algorithmprovider/defaults/defaults.go
View file @
4e39800b
...
...
@@ -34,7 +34,8 @@ import (
const
(
// GCE instances can have up to 16 PD volumes attached.
DefaultMaxGCEPDVolumes
=
16
DefaultMaxGCEPDVolumes
=
16
ClusterAutoscalerProvider
=
"ClusterAutoscalerProvider"
)
// getMaxVols checks the max PD volumes environment variable, otherwise returning a default value
...
...
@@ -54,6 +55,9 @@ func getMaxVols(defaultVal int) int {
func
init
()
{
factory
.
RegisterAlgorithmProvider
(
factory
.
DefaultProvider
,
defaultPredicates
(),
defaultPriorities
())
// Cluster autoscaler friendly scheduling algorithm.
factory
.
RegisterAlgorithmProvider
(
ClusterAutoscalerProvider
,
defaultPredicates
(),
replace
(
defaultPriorities
(),
"LeastRequestedPriority"
,
"MostRequestedPriority"
))
// EqualPriority is a prioritizer function that gives an equal weight of one to all nodes
// Register the priority function so that its available
// but do not include it as part of the default priorities
...
...
@@ -97,6 +101,15 @@ func init() {
factory
.
RegisterPriorityFunction
(
"MostRequestedPriority"
,
priorities
.
MostRequestedPriority
,
1
)
}
func
replace
(
set
sets
.
String
,
replaceWhat
,
replaceWith
string
)
sets
.
String
{
result
:=
sets
.
NewString
(
set
.
List
()
...
)
if
result
.
Has
(
replaceWhat
)
{
result
.
Delete
(
replaceWhat
)
result
.
Insert
(
replaceWith
)
}
return
result
}
func
defaultPredicates
()
sets
.
String
{
return
sets
.
NewString
(
// Fit is determined by non-conflicting disk volumes.
...
...
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