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
a62da3e2
Commit
a62da3e2
authored
Dec 23, 2016
by
NickrenREN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
record ReduceCPULimits result err info if possible
record ReduceCPULimits result err info if possible
parent
8ffada66
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
kubelet_pods.go
pkg/kubelet/kubelet_pods.go
+6
-4
No files found.
pkg/kubelet/kubelet_pods.go
View file @
a62da3e2
...
...
@@ -649,13 +649,13 @@ func (kl *Kubelet) killPod(pod *v1.Pod, runningPod *kubecontainer.Pod, status *k
// cache the pod cgroup Name for reducing the cpu resource limits of the pod cgroup once the pod is killed
pcm
:=
kl
.
containerManager
.
NewPodContainerManager
()
var
podCgroup
cm
.
CgroupName
reduceCpuLimts
:=
true
reduceCpuLim
i
ts
:=
true
if
pod
!=
nil
{
podCgroup
,
_
=
pcm
.
GetPodContainerName
(
pod
)
}
else
{
// If the pod is nil then cgroup limit must have already
// been decreased earlier
reduceCpuLimts
=
false
reduceCpuLim
i
ts
=
false
}
// Call the container runtime KillPod method which stops all running containers of the pod
...
...
@@ -670,8 +670,10 @@ func (kl *Kubelet) killPod(pod *v1.Pod, runningPod *kubecontainer.Pod, status *k
// Hence we only reduce the cpu resource limits of the pod's cgroup
// and defer the responsibilty of destroying the pod's cgroup to the
// cleanup method and the housekeeping loop.
if
reduceCpuLimts
{
pcm
.
ReduceCPULimits
(
podCgroup
)
if
reduceCpuLimits
{
if
err
:=
pcm
.
ReduceCPULimits
(
podCgroup
);
err
!=
nil
{
glog
.
Warningf
(
"Failed to reduce the CPU values to the minimum amount of shares: %v"
,
err
)
}
}
return
nil
}
...
...
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