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
7a352b2b
Commit
7a352b2b
authored
Nov 02, 2018
by
Bobby (Babak) Salamat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not allocate memory for pods that do not have inter-pod affinity/anti-affinity
parent
a5612a15
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
metadata.go
pkg/scheduler/algorithm/predicates/metadata.go
+2
-3
No files found.
pkg/scheduler/algorithm/predicates/metadata.go
View file @
7a352b2b
...
...
@@ -399,7 +399,7 @@ func getTPMapMatchingExistingAntiAffinity(pod *v1.Pod, nodeInfoMap map[string]*s
appendTopologyPairsMaps
(
existingPodTopologyMaps
)
}
}
workqueue
.
Parallelize
(
16
,
len
(
allNodeNames
),
processNode
)
workqueue
.
Parallelize
Until
(
context
.
TODO
(),
16
,
len
(
allNodeNames
),
processNode
)
return
topologyMaps
,
firstError
}
...
...
@@ -408,13 +408,12 @@ func getTPMapMatchingExistingAntiAffinity(pod *v1.Pod, nodeInfoMap map[string]*s
// predicate. With this topologyPairsMaps available, the affinity predicate does not
// need to check all the pods in the cluster.
func
getTPMapMatchingIncomingAffinityAntiAffinity
(
pod
*
v1
.
Pod
,
nodeInfoMap
map
[
string
]
*
schedulercache
.
NodeInfo
)
(
topologyPairsAffinityPodsMaps
*
topologyPairsMaps
,
topologyPairsAntiAffinityPodsMaps
*
topologyPairsMaps
,
err
error
)
{
allNodeNames
:=
make
([]
string
,
0
,
len
(
nodeInfoMap
))
affinity
:=
pod
.
Spec
.
Affinity
if
affinity
==
nil
||
(
affinity
.
PodAffinity
==
nil
&&
affinity
.
PodAntiAffinity
==
nil
)
{
return
newTopologyPairsMaps
(),
newTopologyPairsMaps
(),
nil
}
allNodeNames
:=
make
([]
string
,
0
,
len
(
nodeInfoMap
))
for
name
:=
range
nodeInfoMap
{
allNodeNames
=
append
(
allNodeNames
,
name
)
}
...
...
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