mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	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:
		
							
								
								
									
										2
									
								
								pkg/generated/openapi/zz_generated.openapi.go
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								pkg/generated/openapi/zz_generated.openapi.go
									
									
									
										generated
									
									
									
								
							@@ -54495,7 +54495,7 @@ func schema_k8sio_kubelet_config_v1beta1_KubeletConfiguration(ref common.Referen
 | 
				
			|||||||
					},
 | 
										},
 | 
				
			||||||
					"cpuCFSQuotaPeriod": {
 | 
										"cpuCFSQuotaPeriod": {
 | 
				
			||||||
						SchemaProps: spec.SchemaProps{
 | 
											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"),
 | 
												Ref:         ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"),
 | 
				
			||||||
						},
 | 
											},
 | 
				
			||||||
					},
 | 
										},
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,7 +19,7 @@ containerLogMaxFiles: 5
 | 
				
			|||||||
containerLogMaxSize: 10Mi
 | 
					containerLogMaxSize: 10Mi
 | 
				
			||||||
contentType: application/vnd.kubernetes.protobuf
 | 
					contentType: application/vnd.kubernetes.protobuf
 | 
				
			||||||
cpuCFSQuota: true
 | 
					cpuCFSQuota: true
 | 
				
			||||||
cpuCFSQuotaPeriod: 100ms
 | 
					cpuCFSQuotaPeriod: 100µs
 | 
				
			||||||
cpuManagerPolicy: none
 | 
					cpuManagerPolicy: none
 | 
				
			||||||
cpuManagerReconcilePeriod: 10s
 | 
					cpuManagerReconcilePeriod: 10s
 | 
				
			||||||
enableControllerAttachDetach: true
 | 
					enableControllerAttachDetach: true
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,7 +19,7 @@ containerLogMaxFiles: 5
 | 
				
			|||||||
containerLogMaxSize: 10Mi
 | 
					containerLogMaxSize: 10Mi
 | 
				
			||||||
contentType: application/vnd.kubernetes.protobuf
 | 
					contentType: application/vnd.kubernetes.protobuf
 | 
				
			||||||
cpuCFSQuota: true
 | 
					cpuCFSQuota: true
 | 
				
			||||||
cpuCFSQuotaPeriod: 100ms
 | 
					cpuCFSQuotaPeriod: 100µs
 | 
				
			||||||
cpuManagerPolicy: none
 | 
					cpuManagerPolicy: none
 | 
				
			||||||
cpuManagerReconcilePeriod: 10s
 | 
					cpuManagerReconcilePeriod: 10s
 | 
				
			||||||
enableControllerAttachDetach: true
 | 
					enableControllerAttachDetach: true
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -273,7 +273,7 @@ type KubeletConfiguration struct {
 | 
				
			|||||||
	// cpuCFSQuota enables CPU CFS quota enforcement for containers that
 | 
						// cpuCFSQuota enables CPU CFS quota enforcement for containers that
 | 
				
			||||||
	// specify CPU limits
 | 
						// specify CPU limits
 | 
				
			||||||
	CPUCFSQuota bool
 | 
						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
 | 
						CPUCFSQuotaPeriod metav1.Duration
 | 
				
			||||||
	// maxOpenFiles is Number of files that can be opened by Kubelet process.
 | 
						// maxOpenFiles is Number of files that can be opened by Kubelet process.
 | 
				
			||||||
	MaxOpenFiles int64
 | 
						MaxOpenFiles int64
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -188,7 +188,7 @@ func SetDefaults_KubeletConfiguration(obj *kubeletconfigv1beta1.KubeletConfigura
 | 
				
			|||||||
		obj.CPUCFSQuota = utilpointer.BoolPtr(true)
 | 
							obj.CPUCFSQuota = utilpointer.BoolPtr(true)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if obj.CPUCFSQuotaPeriod == nil {
 | 
						if obj.CPUCFSQuotaPeriod == nil {
 | 
				
			||||||
		obj.CPUCFSQuotaPeriod = &metav1.Duration{Duration: 100 * time.Millisecond}
 | 
							obj.CPUCFSQuotaPeriod = &metav1.Duration{Duration: 100 * time.Microsecond}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if obj.NodeStatusMaxImages == nil {
 | 
						if obj.NodeStatusMaxImages == nil {
 | 
				
			||||||
		obj.NodeStatusMaxImages = utilpointer.Int32Ptr(50)
 | 
							obj.NodeStatusMaxImages = utilpointer.Int32Ptr(50)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -92,7 +92,7 @@ func TestSetDefaultsKubeletConfiguration(t *testing.T) {
 | 
				
			|||||||
				PodPidsLimit:                              utilpointer.Int64(-1),
 | 
									PodPidsLimit:                              utilpointer.Int64(-1),
 | 
				
			||||||
				ResolverConfig:                            utilpointer.String(kubetypes.ResolvConfDefault),
 | 
									ResolverConfig:                            utilpointer.String(kubetypes.ResolvConfDefault),
 | 
				
			||||||
				CPUCFSQuota:                               utilpointer.BoolPtr(true),
 | 
									CPUCFSQuota:                               utilpointer.BoolPtr(true),
 | 
				
			||||||
				CPUCFSQuotaPeriod:                         &metav1.Duration{Duration: 100 * time.Millisecond},
 | 
									CPUCFSQuotaPeriod:                         &metav1.Duration{Duration: 100 * time.Microsecond},
 | 
				
			||||||
				NodeStatusMaxImages:                       utilpointer.Int32Ptr(50),
 | 
									NodeStatusMaxImages:                       utilpointer.Int32Ptr(50),
 | 
				
			||||||
				MaxOpenFiles:                              1000000,
 | 
									MaxOpenFiles:                              1000000,
 | 
				
			||||||
				ContentType:                               "application/vnd.kubernetes.protobuf",
 | 
									ContentType:                               "application/vnd.kubernetes.protobuf",
 | 
				
			||||||
@@ -691,7 +691,7 @@ func TestSetDefaultsKubeletConfiguration(t *testing.T) {
 | 
				
			|||||||
				PodPidsLimit:                              utilpointer.Int64(-1),
 | 
									PodPidsLimit:                              utilpointer.Int64(-1),
 | 
				
			||||||
				ResolverConfig:                            utilpointer.String(kubetypes.ResolvConfDefault),
 | 
									ResolverConfig:                            utilpointer.String(kubetypes.ResolvConfDefault),
 | 
				
			||||||
				CPUCFSQuota:                               utilpointer.BoolPtr(true),
 | 
									CPUCFSQuota:                               utilpointer.BoolPtr(true),
 | 
				
			||||||
				CPUCFSQuotaPeriod:                         &metav1.Duration{Duration: 100 * time.Millisecond},
 | 
									CPUCFSQuotaPeriod:                         &metav1.Duration{Duration: 100 * time.Microsecond},
 | 
				
			||||||
				NodeStatusMaxImages:                       utilpointer.Int32Ptr(50),
 | 
									NodeStatusMaxImages:                       utilpointer.Int32Ptr(50),
 | 
				
			||||||
				MaxOpenFiles:                              1000000,
 | 
									MaxOpenFiles:                              1000000,
 | 
				
			||||||
				ContentType:                               "application/vnd.kubernetes.protobuf",
 | 
									ContentType:                               "application/vnd.kubernetes.protobuf",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -36,7 +36,7 @@ import (
 | 
				
			|||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var (
 | 
					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
 | 
					// ValidateKubeletConfiguration validates `kc` and returns an error if it is invalid
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -115,7 +115,7 @@ type kubeGenericRuntimeManager struct {
 | 
				
			|||||||
	// If true, enforce container cpu limits with CFS quota support
 | 
						// If true, enforce container cpu limits with CFS quota support
 | 
				
			||||||
	cpuCFSQuota bool
 | 
						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
 | 
						cpuCFSQuotaPeriod metav1.Duration
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// wrapped image puller.
 | 
						// wrapped image puller.
 | 
				
			||||||
@@ -152,7 +152,7 @@ type kubeGenericRuntimeManager struct {
 | 
				
			|||||||
	// MemorySwapBehavior defines how swap is used
 | 
						// MemorySwapBehavior defines how swap is used
 | 
				
			||||||
	memorySwapBehavior string
 | 
						memorySwapBehavior string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	//Function to get node allocatable resources
 | 
						// Function to get node allocatable resources
 | 
				
			||||||
	getNodeAllocatable func() v1.ResourceList
 | 
						getNodeAllocatable func() v1.ResourceList
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Memory throttling factor for MemoryQoS
 | 
						// Memory throttling factor for MemoryQoS
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -442,7 +442,7 @@ type KubeletConfiguration struct {
 | 
				
			|||||||
	// cpuCFSQuotaPeriod is the CPU CFS quota period value, `cpu.cfs_period_us`.
 | 
						// cpuCFSQuotaPeriod is the CPU CFS quota period value, `cpu.cfs_period_us`.
 | 
				
			||||||
	// The value must be between 1 us and 1 second, inclusive.
 | 
						// The value must be between 1 us and 1 second, inclusive.
 | 
				
			||||||
	// Requires the CustomCPUCFSQuotaPeriod feature gate to be enabled.
 | 
						// Requires the CustomCPUCFSQuotaPeriod feature gate to be enabled.
 | 
				
			||||||
	// Default: "100ms"
 | 
						// Default: "100µs"
 | 
				
			||||||
	// +optional
 | 
						// +optional
 | 
				
			||||||
	CPUCFSQuotaPeriod *metav1.Duration `json:"cpuCFSQuotaPeriod,omitempty"`
 | 
						CPUCFSQuotaPeriod *metav1.Duration `json:"cpuCFSQuotaPeriod,omitempty"`
 | 
				
			||||||
	// nodeStatusMaxImages caps the number of images reported in Node.status.images.
 | 
						// nodeStatusMaxImages caps the number of images reported in Node.status.images.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user