Merge pull request #111520 from paskal/paskal/clarify_cfs_period_us

Change CPUCFSQuotaPeriod default value from 100ms to 100us to match Linux default
This commit is contained in:
Kubernetes Prow Robot 2022-08-23 20:07:48 -07:00 committed by GitHub
commit 08aac4f0ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 11 additions and 11 deletions

View File

@ -54495,7 +54495,7 @@ func schema_k8sio_kubelet_config_v1beta1_KubeletConfiguration(ref common.Referen
},
"cpuCFSQuotaPeriod": {
SchemaProps: spec.SchemaProps{
Description: "cpuCFSQuotaPeriod is the CPU CFS quota period value, `cpu.cfs_period_us`. The value must be between 1 us and 1 second, inclusive. Requires the CustomCPUCFSQuotaPeriod feature gate to be enabled. Default: \"100ms\"",
Description: "cpuCFSQuotaPeriod is the CPU CFS quota period value, `cpu.cfs_period_us`. The value must be between 1 us and 1 second, inclusive. Requires the CustomCPUCFSQuotaPeriod feature gate to be enabled. Default: \"100µs\"",
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"),
},
},

View File

@ -19,7 +19,7 @@ containerLogMaxFiles: 5
containerLogMaxSize: 10Mi
contentType: application/vnd.kubernetes.protobuf
cpuCFSQuota: true
cpuCFSQuotaPeriod: 100ms
cpuCFSQuotaPeriod: 100µs
cpuManagerPolicy: none
cpuManagerReconcilePeriod: 10s
enableControllerAttachDetach: true

View File

@ -19,7 +19,7 @@ containerLogMaxFiles: 5
containerLogMaxSize: 10Mi
contentType: application/vnd.kubernetes.protobuf
cpuCFSQuota: true
cpuCFSQuotaPeriod: 100ms
cpuCFSQuotaPeriod: 100µs
cpuManagerPolicy: none
cpuManagerReconcilePeriod: 10s
enableControllerAttachDetach: true

View File

@ -273,7 +273,7 @@ type KubeletConfiguration struct {
// cpuCFSQuota enables CPU CFS quota enforcement for containers that
// specify CPU limits
CPUCFSQuota bool
// CPUCFSQuotaPeriod sets the CPU CFS quota period value, cpu.cfs_period_us, defaults to 100ms
// CPUCFSQuotaPeriod sets the CPU CFS quota period value, cpu.cfs_period_us, defaults to 100µs
CPUCFSQuotaPeriod metav1.Duration
// maxOpenFiles is Number of files that can be opened by Kubelet process.
MaxOpenFiles int64

View File

@ -188,7 +188,7 @@ func SetDefaults_KubeletConfiguration(obj *kubeletconfigv1beta1.KubeletConfigura
obj.CPUCFSQuota = utilpointer.BoolPtr(true)
}
if obj.CPUCFSQuotaPeriod == nil {
obj.CPUCFSQuotaPeriod = &metav1.Duration{Duration: 100 * time.Millisecond}
obj.CPUCFSQuotaPeriod = &metav1.Duration{Duration: 100 * time.Microsecond}
}
if obj.NodeStatusMaxImages == nil {
obj.NodeStatusMaxImages = utilpointer.Int32Ptr(50)

View File

@ -92,7 +92,7 @@ func TestSetDefaultsKubeletConfiguration(t *testing.T) {
PodPidsLimit: utilpointer.Int64(-1),
ResolverConfig: utilpointer.String(kubetypes.ResolvConfDefault),
CPUCFSQuota: utilpointer.BoolPtr(true),
CPUCFSQuotaPeriod: &metav1.Duration{Duration: 100 * time.Millisecond},
CPUCFSQuotaPeriod: &metav1.Duration{Duration: 100 * time.Microsecond},
NodeStatusMaxImages: utilpointer.Int32Ptr(50),
MaxOpenFiles: 1000000,
ContentType: "application/vnd.kubernetes.protobuf",
@ -691,7 +691,7 @@ func TestSetDefaultsKubeletConfiguration(t *testing.T) {
PodPidsLimit: utilpointer.Int64(-1),
ResolverConfig: utilpointer.String(kubetypes.ResolvConfDefault),
CPUCFSQuota: utilpointer.BoolPtr(true),
CPUCFSQuotaPeriod: &metav1.Duration{Duration: 100 * time.Millisecond},
CPUCFSQuotaPeriod: &metav1.Duration{Duration: 100 * time.Microsecond},
NodeStatusMaxImages: utilpointer.Int32Ptr(50),
MaxOpenFiles: 1000000,
ContentType: "application/vnd.kubernetes.protobuf",

View File

@ -36,7 +36,7 @@ import (
)
var (
defaultCFSQuota = metav1.Duration{Duration: 100 * time.Millisecond}
defaultCFSQuota = metav1.Duration{Duration: 100 * time.Microsecond}
)
// ValidateKubeletConfiguration validates `kc` and returns an error if it is invalid

View File

@ -115,7 +115,7 @@ type kubeGenericRuntimeManager struct {
// If true, enforce container cpu limits with CFS quota support
cpuCFSQuota bool
// CPUCFSQuotaPeriod sets the CPU CFS quota period value, cpu.cfs_period_us, defaults to 100ms
// CPUCFSQuotaPeriod sets the CPU CFS quota period value, cpu.cfs_period_us, defaults to 100µs
cpuCFSQuotaPeriod metav1.Duration
// wrapped image puller.
@ -152,7 +152,7 @@ type kubeGenericRuntimeManager struct {
// MemorySwapBehavior defines how swap is used
memorySwapBehavior string
//Function to get node allocatable resources
// Function to get node allocatable resources
getNodeAllocatable func() v1.ResourceList
// Memory throttling factor for MemoryQoS

View File

@ -442,7 +442,7 @@ type KubeletConfiguration struct {
// cpuCFSQuotaPeriod is the CPU CFS quota period value, `cpu.cfs_period_us`.
// The value must be between 1 us and 1 second, inclusive.
// Requires the CustomCPUCFSQuotaPeriod feature gate to be enabled.
// Default: "100ms"
// Default: "100µs"
// +optional
CPUCFSQuotaPeriod *metav1.Duration `json:"cpuCFSQuotaPeriod,omitempty"`
// nodeStatusMaxImages caps the number of images reported in Node.status.images.