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
7e894b33
Commit
7e894b33
authored
May 15, 2018
by
xuzhonghu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pass stop channel to node-controller
parent
e34df0a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
controllermanager.go
cmd/cloud-controller-manager/app/controllermanager.go
+2
-3
node_controller.go
pkg/controller/cloud/node_controller.go
+3
-3
No files found.
cmd/cloud-controller-manager/app/controllermanager.go
View file @
7e894b33
...
@@ -216,13 +216,12 @@ func startControllers(c *cloudcontrollerconfig.CompletedConfig, rootClientBuilde
...
@@ -216,13 +216,12 @@ func startControllers(c *cloudcontrollerconfig.CompletedConfig, rootClientBuilde
c
.
Generic
.
ComponentConfig
.
KubeCloudShared
.
NodeMonitorPeriod
.
Duration
,
c
.
Generic
.
ComponentConfig
.
KubeCloudShared
.
NodeMonitorPeriod
.
Duration
,
c
.
Extra
.
NodeStatusUpdateFrequency
)
c
.
Extra
.
NodeStatusUpdateFrequency
)
nodeController
.
Run
()
nodeController
.
Run
(
stop
)
time
.
Sleep
(
wait
.
Jitter
(
c
.
Generic
.
ComponentConfig
.
GenericComponent
.
ControllerStartInterval
.
Duration
,
ControllerStartJitter
))
time
.
Sleep
(
wait
.
Jitter
(
c
.
Generic
.
ComponentConfig
.
GenericComponent
.
ControllerStartInterval
.
Duration
,
ControllerStartJitter
))
// Start the PersistentVolumeLabelController
// Start the PersistentVolumeLabelController
pvlController
:=
cloudcontrollers
.
NewPersistentVolumeLabelController
(
client
(
"pvl-controller"
),
cloud
)
pvlController
:=
cloudcontrollers
.
NewPersistentVolumeLabelController
(
client
(
"pvl-controller"
),
cloud
)
threads
:=
5
go
pvlController
.
Run
(
5
,
stop
)
go
pvlController
.
Run
(
threads
,
stop
)
time
.
Sleep
(
wait
.
Jitter
(
c
.
Generic
.
ComponentConfig
.
GenericComponent
.
ControllerStartInterval
.
Duration
,
ControllerStartJitter
))
time
.
Sleep
(
wait
.
Jitter
(
c
.
Generic
.
ComponentConfig
.
GenericComponent
.
ControllerStartInterval
.
Duration
,
ControllerStartJitter
))
// Start the service controller
// Start the service controller
...
...
pkg/controller/cloud/node_controller.go
View file @
7e894b33
...
@@ -112,7 +112,7 @@ func NewCloudNodeController(
...
@@ -112,7 +112,7 @@ func NewCloudNodeController(
// This controller deletes a node if kubelet is not reporting
// This controller deletes a node if kubelet is not reporting
// and the node is gone from the cloud provider.
// and the node is gone from the cloud provider.
func
(
cnc
*
CloudNodeController
)
Run
()
{
func
(
cnc
*
CloudNodeController
)
Run
(
stopCh
<-
chan
struct
{}
)
{
defer
utilruntime
.
HandleCrash
()
defer
utilruntime
.
HandleCrash
()
// The following loops run communicate with the APIServer with a worst case complexity
// The following loops run communicate with the APIServer with a worst case complexity
...
@@ -120,10 +120,10 @@ func (cnc *CloudNodeController) Run() {
...
@@ -120,10 +120,10 @@ func (cnc *CloudNodeController) Run() {
// very infrequently. DO NOT MODIFY this to perform frequent operations.
// very infrequently. DO NOT MODIFY this to perform frequent operations.
// Start a loop to periodically update the node addresses obtained from the cloud
// Start a loop to periodically update the node addresses obtained from the cloud
go
wait
.
Until
(
cnc
.
UpdateNodeStatus
,
cnc
.
nodeStatusUpdateFrequency
,
wait
.
NeverStop
)
go
wait
.
Until
(
cnc
.
UpdateNodeStatus
,
cnc
.
nodeStatusUpdateFrequency
,
stopCh
)
// Start a loop to periodically check if any nodes have been deleted from cloudprovider
// Start a loop to periodically check if any nodes have been deleted from cloudprovider
go
wait
.
Until
(
cnc
.
MonitorNode
,
cnc
.
nodeMonitorPeriod
,
wait
.
NeverStop
)
go
wait
.
Until
(
cnc
.
MonitorNode
,
cnc
.
nodeMonitorPeriod
,
stopCh
)
}
}
// UpdateNodeStatus updates the node status, such as node addresses
// UpdateNodeStatus updates the node status, such as node addresses
...
...
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