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
bf9416c9
Commit
bf9416c9
authored
Jun 17, 2015
by
Brendan Burns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update the kubelet to ignore syncing Pods until the container runtime is up.
parent
0f374050
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
kubelet.go
pkg/kubelet/kubelet.go
+12
-5
No files found.
pkg/kubelet/kubelet.go
View file @
bf9416c9
...
@@ -1663,6 +1663,11 @@ func (kl *Kubelet) admitPods(allPods []*api.Pod, podSyncTypes map[types.UID]Sync
...
@@ -1663,6 +1663,11 @@ func (kl *Kubelet) admitPods(allPods []*api.Pod, podSyncTypes map[types.UID]Sync
func
(
kl
*
Kubelet
)
syncLoop
(
updates
<-
chan
PodUpdate
,
handler
SyncHandler
)
{
func
(
kl
*
Kubelet
)
syncLoop
(
updates
<-
chan
PodUpdate
,
handler
SyncHandler
)
{
glog
.
Info
(
"Starting kubelet main sync loop."
)
glog
.
Info
(
"Starting kubelet main sync loop."
)
for
{
for
{
if
!
kl
.
containerRuntimeUp
()
{
time
.
Sleep
(
5
*
time
.
Second
)
glog
.
Infof
(
"Skipping pod synchronization, container runtime is not up."
)
continue
}
unsyncedPod
:=
false
unsyncedPod
:=
false
podSyncTypes
:=
make
(
map
[
types
.
UID
]
SyncPodType
)
podSyncTypes
:=
make
(
map
[
types
.
UID
]
SyncPodType
)
select
{
select
{
...
@@ -1923,11 +1928,7 @@ func (kl *Kubelet) setNodeStatus(node *api.Node) error {
...
@@ -1923,11 +1928,7 @@ func (kl *Kubelet) setNodeStatus(node *api.Node) error {
}
}
// Check whether container runtime can be reported as up.
// Check whether container runtime can be reported as up.
containerRuntimeUp
:=
func
()
bool
{
containerRuntimeUp
:=
kl
.
containerRuntimeUp
()
kl
.
runtimeMutex
.
Lock
()
defer
kl
.
runtimeMutex
.
Unlock
()
return
kl
.
lastTimestampRuntimeUp
.
Add
(
kl
.
runtimeUpThreshold
)
.
After
(
time
.
Now
())
}()
currentTime
:=
util
.
Now
()
currentTime
:=
util
.
Now
()
var
newNodeReadyCondition
api
.
NodeCondition
var
newNodeReadyCondition
api
.
NodeCondition
...
@@ -1990,6 +1991,12 @@ func (kl *Kubelet) setNodeStatus(node *api.Node) error {
...
@@ -1990,6 +1991,12 @@ func (kl *Kubelet) setNodeStatus(node *api.Node) error {
return
nil
return
nil
}
}
func
(
kl
*
Kubelet
)
containerRuntimeUp
()
bool
{
kl
.
runtimeMutex
.
Lock
()
defer
kl
.
runtimeMutex
.
Unlock
()
return
kl
.
lastTimestampRuntimeUp
.
Add
(
kl
.
runtimeUpThreshold
)
.
After
(
time
.
Now
())
}
// tryUpdateNodeStatus tries to update node status to master. If ReconcileCBR0
// tryUpdateNodeStatus tries to update node status to master. If ReconcileCBR0
// is set, this function will also confirm that cbr0 is configured correctly.
// is set, this function will also confirm that cbr0 is configured correctly.
func
(
kl
*
Kubelet
)
tryUpdateNodeStatus
()
error
{
func
(
kl
*
Kubelet
)
tryUpdateNodeStatus
()
error
{
...
...
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