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
e7befa2a
Commit
e7befa2a
authored
Oct 14, 2016
by
Andy Goldstein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only wait for cache syncs once in NodeController
parent
928b8cbd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
nodecontroller.go
pkg/controller/node/nodecontroller.go
+8
-11
No files found.
pkg/controller/node/nodecontroller.go
View file @
e7befa2a
...
@@ -356,12 +356,16 @@ func NewNodeController(
...
@@ -356,12 +356,16 @@ func NewNodeController(
// Run starts an asynchronous loop that monitors the status of cluster nodes.
// Run starts an asynchronous loop that monitors the status of cluster nodes.
func
(
nc
*
NodeController
)
Run
()
{
func
(
nc
*
NodeController
)
Run
()
{
// Incorporate the results of node status pushed from kubelet to master.
go
func
()
{
go
wait
.
Until
(
func
()
{
defer
utilruntime
.
HandleCrash
()
if
!
cache
.
WaitForCacheSync
(
wait
.
NeverStop
,
nc
.
nodeInformer
.
Informer
()
.
HasSynced
,
nc
.
podInformer
.
Informer
()
.
HasSynced
,
nc
.
daemonSetInformer
.
Informer
()
.
HasSynced
)
{
if
!
cache
.
WaitForCacheSync
(
wait
.
NeverStop
,
nc
.
nodeInformer
.
Informer
()
.
HasSynced
,
nc
.
podInformer
.
Informer
()
.
HasSynced
,
nc
.
daemonSetInformer
.
Informer
()
.
HasSynced
)
{
glog
.
Errorf
(
"NodeController timed out while waiting for informers to sync..."
)
utilruntime
.
HandleError
(
errors
.
New
(
"NodeController timed out while waiting for informers to sync..."
)
)
return
return
}
}
// Incorporate the results of node status pushed from kubelet to master.
go
wait
.
Until
(
func
()
{
if
err
:=
nc
.
monitorNodeStatus
();
err
!=
nil
{
if
err
:=
nc
.
monitorNodeStatus
();
err
!=
nil
{
glog
.
Errorf
(
"Error monitoring node status: %v"
,
err
)
glog
.
Errorf
(
"Error monitoring node status: %v"
,
err
)
}
}
...
@@ -380,10 +384,6 @@ func (nc *NodeController) Run() {
...
@@ -380,10 +384,6 @@ func (nc *NodeController) Run() {
// c. If there are pods still terminating, wait for their estimated completion
// c. If there are pods still terminating, wait for their estimated completion
// before retrying
// before retrying
go
wait
.
Until
(
func
()
{
go
wait
.
Until
(
func
()
{
if
!
cache
.
WaitForCacheSync
(
wait
.
NeverStop
,
nc
.
nodeInformer
.
Informer
()
.
HasSynced
,
nc
.
podInformer
.
Informer
()
.
HasSynced
,
nc
.
daemonSetInformer
.
Informer
()
.
HasSynced
)
{
glog
.
Errorf
(
"NodeController timed out while waiting for informers to sync..."
)
return
}
nc
.
evictorLock
.
Lock
()
nc
.
evictorLock
.
Lock
()
defer
nc
.
evictorLock
.
Unlock
()
defer
nc
.
evictorLock
.
Unlock
()
for
k
:=
range
nc
.
zonePodEvictor
{
for
k
:=
range
nc
.
zonePodEvictor
{
...
@@ -417,10 +417,6 @@ func (nc *NodeController) Run() {
...
@@ -417,10 +417,6 @@ func (nc *NodeController) Run() {
// TODO: replace with a controller that ensures pods that are terminating complete
// TODO: replace with a controller that ensures pods that are terminating complete
// in a particular time period
// in a particular time period
go
wait
.
Until
(
func
()
{
go
wait
.
Until
(
func
()
{
if
!
cache
.
WaitForCacheSync
(
wait
.
NeverStop
,
nc
.
nodeInformer
.
Informer
()
.
HasSynced
,
nc
.
podInformer
.
Informer
()
.
HasSynced
,
nc
.
daemonSetInformer
.
Informer
()
.
HasSynced
)
{
glog
.
Errorf
(
"NodeController timed out while waiting for informers to sync..."
)
return
}
nc
.
evictorLock
.
Lock
()
nc
.
evictorLock
.
Lock
()
defer
nc
.
evictorLock
.
Unlock
()
defer
nc
.
evictorLock
.
Unlock
()
for
k
:=
range
nc
.
zoneTerminationEvictor
{
for
k
:=
range
nc
.
zoneTerminationEvictor
{
...
@@ -447,6 +443,7 @@ func (nc *NodeController) Run() {
...
@@ -447,6 +443,7 @@ func (nc *NodeController) Run() {
})
})
}
}
},
nodeEvictionPeriod
,
wait
.
NeverStop
)
},
nodeEvictionPeriod
,
wait
.
NeverStop
)
}()
}
}
// monitorNodeStatus verifies node status are constantly updated by kubelet, and if not,
// monitorNodeStatus verifies node status are constantly updated by kubelet, and if not,
...
...
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