mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
1. Make kubelet default to 10ms for CPU quota if limit < 10m for
backwards compat. 2. Update documentation to reflect minimum CPU limits. Signed-off-by: Vishnu kannan <vishnuk@google.com>
This commit is contained in:
@@ -50,7 +50,8 @@ const (
|
||||
milliCPUToCPU = 1000
|
||||
|
||||
// 100000 is equivalent to 100ms
|
||||
quotaPeriod = 100000
|
||||
quotaPeriod = 100000
|
||||
minQuotaPerod = 1000
|
||||
)
|
||||
|
||||
// DockerInterface is an abstract interface for testability. It abstracts the interface of docker.Client.
|
||||
@@ -317,6 +318,11 @@ func milliCPUToQuota(milliCPU int64) (quota int64, period int64) {
|
||||
// we then convert your milliCPU to a value normalized over a period
|
||||
quota = (milliCPU * quotaPeriod) / milliCPUToCPU
|
||||
|
||||
// quota needs to be a minimum of 1ms.
|
||||
if quota < minQuotaPerod {
|
||||
quota = minQuotaPerod
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user