Commit feb4b485 authored by k8s-merge-robot's avatar k8s-merge-robot

Merge pull request #19890 from vishh/0-nodes

Auto commit by PR queue bot
parents 7e158006 21748701
...@@ -2137,9 +2137,7 @@ func hasHostPortConflicts(pods []*api.Pod) bool { ...@@ -2137,9 +2137,7 @@ func hasHostPortConflicts(pods []*api.Pod) bool {
return false return false
} }
// hasInsufficientfFreeResources detects pods that exceeds node's resources. // hasInsufficientfFreeResources detects pods that exceeds node's cpu and memory resource.
// TODO: Consider integrate disk space into this function, and returns a
// suitable reason and message per resource type.
func (kl *Kubelet) hasInsufficientfFreeResources(pods []*api.Pod) (bool, bool) { func (kl *Kubelet) hasInsufficientfFreeResources(pods []*api.Pod) (bool, bool) {
info, err := kl.GetCachedMachineInfo() info, err := kl.GetCachedMachineInfo()
if err != nil { if err != nil {
......
...@@ -273,8 +273,8 @@ func CheckPodsExceedingFreeResources(pods []*api.Pod, allocatable api.ResourceLi ...@@ -273,8 +273,8 @@ func CheckPodsExceedingFreeResources(pods []*api.Pod, allocatable api.ResourceLi
memoryRequested := int64(0) memoryRequested := int64(0)
for _, pod := range pods { for _, pod := range pods {
podRequest := getResourceRequest(pod) podRequest := getResourceRequest(pod)
fitsCPU := totalMilliCPU == 0 || (totalMilliCPU-milliCPURequested) >= podRequest.milliCPU fitsCPU := (totalMilliCPU - milliCPURequested) >= podRequest.milliCPU
fitsMemory := totalMemory == 0 || (totalMemory-memoryRequested) >= podRequest.memory fitsMemory := (totalMemory - memoryRequested) >= podRequest.memory
if !fitsCPU { if !fitsCPU {
// the pod doesn't fit due to CPU request // the pod doesn't fit due to CPU request
notFittingCPU = append(notFittingCPU, pod) notFittingCPU = append(notFittingCPU, pod)
......
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