mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Improved logging in scheduler
This commit is contained in:
parent
0f8adc5d53
commit
659de4d7d0
@ -159,21 +159,21 @@ func (r *ResourceFit) PodFitsResources(pod *api.Pod, existingPods []*api.Pod, no
|
|||||||
pods = append(existingPods, pod)
|
pods = append(existingPods, pod)
|
||||||
_, exceedingCPU, exceedingMemory := CheckPodsExceedingFreeResources(pods, info.Status.Capacity)
|
_, exceedingCPU, exceedingMemory := CheckPodsExceedingFreeResources(pods, info.Status.Capacity)
|
||||||
if int64(len(pods)) > info.Status.Capacity.Pods().Value() {
|
if int64(len(pods)) > info.Status.Capacity.Pods().Value() {
|
||||||
glog.V(4).Infof("Cannot schedule Pod %v, because Node %v is full, running %v out of %v Pods.", pod, node, len(pods)-1, info.Status.Capacity.Pods().Value())
|
glog.V(4).Infof("Cannot schedule Pod %+v, because Node %+v is full, running %v out of %v Pods.", pod, node, len(pods)-1, info.Status.Capacity.Pods().Value())
|
||||||
FailedResourceType = "PodExceedsMaxPodNumber"
|
FailedResourceType = "PodExceedsMaxPodNumber"
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
if len(exceedingCPU) > 0 {
|
if len(exceedingCPU) > 0 {
|
||||||
glog.V(4).Infof("Cannot schedule Pod %v, because Node does not have sufficient CPU", pod)
|
glog.V(4).Infof("Cannot schedule Pod %+v, because Node does not have sufficient CPU", pod)
|
||||||
FailedResourceType = "PodExceedsFreeCPU"
|
FailedResourceType = "PodExceedsFreeCPU"
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
if len(exceedingMemory) > 0 {
|
if len(exceedingMemory) > 0 {
|
||||||
glog.V(4).Infof("Cannot schedule Pod %v, because Node does not have sufficient Memory", pod)
|
glog.V(4).Infof("Cannot schedule Pod %+v, because Node does not have sufficient Memory", pod)
|
||||||
FailedResourceType = "PodExceedsFreeMemory"
|
FailedResourceType = "PodExceedsFreeMemory"
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
glog.V(4).Infof("Schedule Pod %v on Node %v is allowed, Node is running only %v out of %v Pods.", pod, node, len(pods)-1, info.Status.Capacity.Pods().Value())
|
glog.V(4).Infof("Schedule Pod %+v on Node %+v is allowed, Node is running only %v out of %v Pods.", pod, node, len(pods)-1, info.Status.Capacity.Pods().Value())
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user