diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index 6b9f8fe7345..a756b8a1b95 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -242,6 +242,10 @@ func makePortsAndBindings(container *api.Container) (map[docker.Port]struct{}, m } func milliCPUToShares(milliCPU int) int { + if milliCPU == 0 { + // zero milliCPU means unset. Use kernel default. + return 0 + } // Conceptually (milliCPU / milliCPUToCPU) * sharesPerCPU, but factored to improve rounding. shares := (milliCPU * sharesPerCPU) / milliCPUToCPU if shares < minShares {