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
f1551798
Commit
f1551798
authored
Jun 13, 2018
by
Seth Jennings
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reduce logging for backoff situations
parent
60cd056c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
kubelet.go
pkg/kubelet/kubelet.go
+10
-3
kuberuntime_manager.go
pkg/kubelet/kuberuntime/kuberuntime_manager.go
+3
-3
No files found.
pkg/kubelet/kubelet.go
View file @
f1551798
...
...
@@ -1624,9 +1624,16 @@ func (kl *Kubelet) syncPod(o syncPodOptions) error {
result
:=
kl
.
containerRuntime
.
SyncPod
(
pod
,
apiPodStatus
,
podStatus
,
pullSecrets
,
kl
.
backOff
)
kl
.
reasonCache
.
Update
(
pod
.
UID
,
result
)
if
err
:=
result
.
Error
();
err
!=
nil
{
// Do not record an event here, as we keep all event logging for sync pod failures
// local to container runtime so we get better errors
return
err
// Do not return error if the only failures were pods in backoff
for
_
,
r
:=
range
result
.
SyncResults
{
if
r
.
Error
!=
kubecontainer
.
ErrCrashLoopBackOff
&&
r
.
Error
!=
images
.
ErrImagePullBackOff
{
// Do not record an event here, as we keep all event logging for sync pod failures
// local to container runtime so we get better errors
return
err
}
}
return
nil
}
return
nil
...
...
pkg/kubelet/kuberuntime/kuberuntime_manager.go
View file @
f1551798
...
...
@@ -510,7 +510,7 @@ func (m *kubeGenericRuntimeManager) computePodActions(pod *v1.Pod, podStatus *ku
if
containerStatus
==
nil
||
containerStatus
.
State
!=
kubecontainer
.
ContainerStateRunning
{
if
kubecontainer
.
ShouldContainerBeRestarted
(
&
container
,
pod
,
podStatus
)
{
message
:=
fmt
.
Sprintf
(
"Container %+v is dead, but RestartPolicy says that we should restart it."
,
container
)
glog
.
Info
(
message
)
glog
.
V
(
3
)
.
Infof
(
message
)
changes
.
ContainersToStart
=
append
(
changes
.
ContainersToStart
,
idx
)
}
continue
...
...
@@ -754,7 +754,7 @@ func (m *kubeGenericRuntimeManager) doBackOff(pod *v1.Pod, container *v1.Contain
return
false
,
""
,
nil
}
glog
.
Infof
(
"checking backoff for container %q in pod %q"
,
container
.
Name
,
format
.
Pod
(
pod
))
glog
.
V
(
3
)
.
Infof
(
"checking backoff for container %q in pod %q"
,
container
.
Name
,
format
.
Pod
(
pod
))
// Use the finished time of the latest exited container as the start point to calculate whether to do back-off.
ts
:=
cStatus
.
FinishedAt
// backOff requires a unique key to identify the container.
...
...
@@ -764,7 +764,7 @@ func (m *kubeGenericRuntimeManager) doBackOff(pod *v1.Pod, container *v1.Contain
m
.
recorder
.
Eventf
(
ref
,
v1
.
EventTypeWarning
,
events
.
BackOffStartContainer
,
"Back-off restarting failed container"
)
}
err
:=
fmt
.
Errorf
(
"Back-off %s restarting failed container=%s pod=%s"
,
backOff
.
Get
(
key
),
container
.
Name
,
format
.
Pod
(
pod
))
glog
.
Infof
(
"%s"
,
err
.
Error
())
glog
.
V
(
3
)
.
Infof
(
"%s"
,
err
.
Error
())
return
true
,
err
.
Error
(),
kubecontainer
.
ErrCrashLoopBackOff
}
...
...
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