Change:
<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks! If the matter is security related, please disclose it privately via --See for more context. What happened: When you set and , you'd expect container cfs quota period to be . However, unless you also set in the feature flags, the quota value will be silently ignored. What you expected to happen: At least a warning be logged if the feature is not enabled but is set. How to reproduce it (as minimally and precisely as possible): Anything else we need to know?: Environment: Kubernetes version (use ): Cloud provider or hardware configuration: OS (e.g: ): Kernel (e.g. ): Install tools: Network plugin and version (if this is a network-related bug): Others:
/sig node /assign karan
The label(s) cannot be applied, because the repository doesn't have them <detailsIn response to : /sig node Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details

Discussion:
"//pkg/kubelet/apis/config:go_default_library", "//pkg/kubelet/cm/cpuset:go_default_library", "//pkg/kubelet/types:go_default_library", <ins> "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", </ins> "//staging/src/k8s.io/apimachinery/pkg/util/errors:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/util/validation:go_default_library", "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library",

"fmt" "time" <ins> metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" </ins> utilerrors "k8s.io/apimachinery/pkg/util/errors" utilvalidation "k8s.io/apimachinery/pkg/util/validation" utilfeature "k8s.io/apiserver/pkg/util/feature"

kubetypes "k8s.io/kubernetes/pkg/kubelet/types" ) <ins> var ( defaultCFSQuota = metav1.Duration{Duration: 100 * time.Millisecond} ) </ins> // ValidateKubeletConfiguration validates `kc` and returns an error if it is invalid func ValidateKubeletConfiguration(kc *kubeletconfig.KubeletConfiguration) error { allErrors := []error{}

if kc.HealthzPort != 0 && utilvalidation.IsValidPortNum(int(kc.HealthzPort)) != nil { allErrors = append(allErrors, fmt.Errorf("invalid configuration: HealthzPort (--healthz-port) %v must be between 1 and 65535, inclusive", kc.HealthzPort)) } <ins> if !localFeatureGate.Enabled(features.CPUCFSQuotaPeriod) && kc.CPUCFSQuotaPeriod != defaultCFSQuota { allErrors = append(allErrors, fmt.Errorf("invalid configuration: CPUCFSQuotaPeriod %v requires feature gate CustomCPUCFSQuotaPeriod", kc.CPUCFSQuotaPeriod)) } </ins> if localFeatureGate.Enabled(features.CPUCFSQuotaPeriod) && utilvalidation.IsInRange(int(kc.CPUCFSQuotaPeriod.Duration), int(1*time.Microsecond), int(time.Second)) != nil { allErrors = append(allErrors, fmt.Errorf("invalid configuration: CPUCFSQuotaPeriod (--cpu-cfs-quota-period) %v must be between 1usec and 1sec, inclusive", kc.CPUCFSQuotaPeriod)) }

RegistryPullQPS:             5, HairpinMode:                 kubeletconfig.PromiscuousBridge, NodeLeaseDurationSeconds:    1, <del> CPUCFSQuotaPeriod:           metav1.Duration{Duration: 100 * time.Millisecond}, </del> <ins> CPUCFSQuotaPeriod:           metav1.Duration{Duration: 25 * time.Millisecond}, FeatureGates: map[string]bool{ "CustomCPUCFSQuotaPeriod": true, }, </ins> } if allErrors := ValidateKubeletConfiguration(successCase1); allErrors != nil { t.Errorf("expect no errors, got %v", allErrors)

RegistryPullQPS:             5, HairpinMode:                 kubeletconfig.PromiscuousBridge, NodeLeaseDurationSeconds:    1, <del> CPUCFSQuotaPeriod:           metav1.Duration{Duration: 100 * time.Millisecond}, </del> <ins> CPUCFSQuotaPeriod:           metav1.Duration{Duration: 50 * time.Millisecond}, </ins> ReservedSystemCPUs:          "0-3", <ins> FeatureGates: map[string]bool{ "CustomCPUCFSQuotaPeriod": true, }, </ins> } if allErrors := ValidateKubeletConfiguration(successCase2); allErrors != nil { t.Errorf("expect no errors, got %v", allErrors)

RegistryPullQPS:             -10, HairpinMode:                 "foo", NodeLeaseDurationSeconds:    -1, <del> CPUCFSQuotaPeriod:           metav1.Duration{Duration: 0}, </del> <ins> CPUCFSQuotaPeriod:           metav1.Duration{Duration: 100 * time.Millisecond}, </ins> } const numErrsErrorCase1 = 25 if allErrors := ValidateKubeletConfiguration(errorCase1); len(allErrors.(utilerrors.Aggregate).Errors()) != numErrsErrorCase1 {

RegistryPullQPS:             5, HairpinMode:                 kubeletconfig.PromiscuousBridge, NodeLeaseDurationSeconds:    1, <del> CPUCFSQuotaPeriod:           metav1.Duration{Duration: 100 * time.Millisecond}, </del> <ins> CPUCFSQuotaPeriod:           metav1.Duration{Duration: 50 * time.Millisecond}, </ins> ReservedSystemCPUs:          "0-3", <ins> FeatureGates: map[string]bool{ "CustomCPUCFSQuotaPeriod": true, }, </ins> } const numErrsErrorCase2 = 1 if allErrors := ValidateKubeletConfiguration(errorCase2); len(allErrors.(utilerrors.Aggregate).Errors()) != numErrsErrorCase2 {