Commit 3a6fa67f authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #39179 from NickrenREN/killpod

Automatic merge from submit-queue (batch tested with PRs 41196, 41252, 41300, 39179, 41449) record ReduceCPULimits result err info if err returned record ReduceCPULimits result err info if err returned for debug
parents b3a34af3 a62da3e2
...@@ -650,13 +650,13 @@ func (kl *Kubelet) killPod(pod *v1.Pod, runningPod *kubecontainer.Pod, status *k ...@@ -650,13 +650,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 // cache the pod cgroup Name for reducing the cpu resource limits of the pod cgroup once the pod is killed
pcm := kl.containerManager.NewPodContainerManager() pcm := kl.containerManager.NewPodContainerManager()
var podCgroup cm.CgroupName var podCgroup cm.CgroupName
reduceCpuLimts := true reduceCpuLimits := true
if pod != nil { if pod != nil {
podCgroup, _ = pcm.GetPodContainerName(pod) podCgroup, _ = pcm.GetPodContainerName(pod)
} else { } else {
// If the pod is nil then cgroup limit must have already // If the pod is nil then cgroup limit must have already
// been decreased earlier // been decreased earlier
reduceCpuLimts = false reduceCpuLimits = false
} }
// Call the container runtime KillPod method which stops all running containers of the pod // Call the container runtime KillPod method which stops all running containers of the pod
...@@ -671,8 +671,10 @@ func (kl *Kubelet) killPod(pod *v1.Pod, runningPod *kubecontainer.Pod, status *k ...@@ -671,8 +671,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 // 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 // and defer the responsibilty of destroying the pod's cgroup to the
// cleanup method and the housekeeping loop. // cleanup method and the housekeeping loop.
if reduceCpuLimts { if reduceCpuLimits {
pcm.ReduceCPULimits(podCgroup) 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 return nil
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment