Remove general available feature-gate CPUManager

Signed-off-by: carlory <baofa.fan@daocloud.io>
This commit is contained in:
carlory 2024-12-19 14:30:07 +08:00
parent d383020cc8
commit 0882efaf8e
6 changed files with 6 additions and 37 deletions

View File

@ -84,11 +84,6 @@ const (
// Enable nodes to change CPUCFSQuotaPeriod // Enable nodes to change CPUCFSQuotaPeriod
CPUCFSQuotaPeriod featuregate.Feature = "CustomCPUCFSQuotaPeriod" CPUCFSQuotaPeriod featuregate.Feature = "CustomCPUCFSQuotaPeriod"
// owner: @ConnorDoyle, @fromanirh (only for GA graduation)
//
// Alternative container-level CPU affinity policies.
CPUManager featuregate.Feature = "CPUManager"
// owner: @fromanirh // owner: @fromanirh
// beta: see below. // beta: see below.
// //
@ -1046,12 +1041,6 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate
{Version: version.MustParse("1.12"), Default: false, PreRelease: featuregate.Alpha}, {Version: version.MustParse("1.12"), Default: false, PreRelease: featuregate.Alpha},
}, },
CPUManager: {
{Version: version.MustParse("1.8"), Default: false, PreRelease: featuregate.Alpha},
{Version: version.MustParse("1.10"), Default: true, PreRelease: featuregate.Beta},
{Version: version.MustParse("1.26"), Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.26
},
CPUManagerPolicyAlphaOptions: { CPUManagerPolicyAlphaOptions: {
{Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha}, {Version: version.MustParse("1.23"), Default: false, PreRelease: featuregate.Alpha},
}, },

View File

@ -66516,7 +66516,7 @@ func schema_k8sio_kubelet_config_v1beta1_KubeletConfiguration(ref common.Referen
}, },
"cpuManagerPolicy": { "cpuManagerPolicy": {
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Description: "cpuManagerPolicy is the name of the policy to use. Requires the CPUManager feature gate to be enabled. Default: \"None\"", Description: "cpuManagerPolicy is the name of the policy to use. Default: \"None\"",
Type: []string{"string"}, Type: []string{"string"},
Format: "", Format: "",
}, },
@ -66546,7 +66546,7 @@ func schema_k8sio_kubelet_config_v1beta1_KubeletConfiguration(ref common.Referen
}, },
"cpuManagerReconcilePeriod": { "cpuManagerReconcilePeriod": {
SchemaProps: spec.SchemaProps{ SchemaProps: spec.SchemaProps{
Description: "cpuManagerReconcilePeriod is the reconciliation period for the CPU Manager. Requires the CPUManager feature gate to be enabled. Default: \"10s\"", Description: "cpuManagerReconcilePeriod is the reconciliation period for the CPU Manager. Default: \"10s\"",
Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"), Ref: ref("k8s.io/apimachinery/pkg/apis/meta/v1.Duration"),
}, },
}, },

View File

@ -253,13 +253,11 @@ type KubeletConfiguration struct {
// a group. It means that if true, the behavior aligns with the behavior of cgroups v1. // a group. It means that if true, the behavior aligns with the behavior of cgroups v1.
SingleProcessOOMKill *bool SingleProcessOOMKill *bool
// CPUManagerPolicy is the name of the policy to use. // CPUManagerPolicy is the name of the policy to use.
// Requires the CPUManager feature gate to be enabled.
CPUManagerPolicy string CPUManagerPolicy string
// CPUManagerPolicyOptions is a set of key=value which allows to set extra options // CPUManagerPolicyOptions is a set of key=value which allows to set extra options
// to fine tune the behaviour of the cpu manager policies. // to fine tune the behaviour of the cpu manager policies.
CPUManagerPolicyOptions map[string]string CPUManagerPolicyOptions map[string]string
// CPU Manager reconciliation period. // CPU Manager reconciliation period.
// Requires the CPUManager feature gate to be enabled.
CPUManagerReconcilePeriod metav1.Duration CPUManagerReconcilePeriod metav1.Duration
// MemoryManagerPolicy is the name of the policy to use. // MemoryManagerPolicy is the name of the policy to use.
// Requires the MemoryManager feature gate to be enabled. // Requires the MemoryManager feature gate to be enabled.

View File

@ -2867,13 +2867,11 @@ func (kl *Kubelet) HandlePodSyncs(pods []*v1.Pod) {
// otherwise. // otherwise.
func (kl *Kubelet) canResizePod(pod *v1.Pod) (bool, string, string) { func (kl *Kubelet) canResizePod(pod *v1.Pod) (bool, string, string) {
if v1qos.GetPodQOS(pod) == v1.PodQOSGuaranteed && !utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScalingExclusiveCPUs) { if v1qos.GetPodQOS(pod) == v1.PodQOSGuaranteed && !utilfeature.DefaultFeatureGate.Enabled(features.InPlacePodVerticalScalingExclusiveCPUs) {
if utilfeature.DefaultFeatureGate.Enabled(features.CPUManager) {
if kl.containerManager.GetNodeConfig().CPUManagerPolicy == "static" { if kl.containerManager.GetNodeConfig().CPUManagerPolicy == "static" {
msg := "Resize is infeasible for Guaranteed Pods alongside CPU Manager static policy" msg := "Resize is infeasible for Guaranteed Pods alongside CPU Manager static policy"
klog.V(3).InfoS(msg, "pod", format.Pod(pod)) klog.V(3).InfoS(msg, "pod", format.Pod(pod))
return false, v1.PodReasonInfeasible, msg return false, v1.PodReasonInfeasible, msg
} }
}
if utilfeature.DefaultFeatureGate.Enabled(features.MemoryManager) { if utilfeature.DefaultFeatureGate.Enabled(features.MemoryManager) {
if kl.containerManager.GetNodeConfig().MemoryManagerPolicy == "Static" { if kl.containerManager.GetNodeConfig().MemoryManagerPolicy == "Static" {
msg := "Resize is infeasible for Guaranteed Pods alongside Memory Manager static policy" msg := "Resize is infeasible for Guaranteed Pods alongside Memory Manager static policy"

View File

@ -391,7 +391,6 @@ type KubeletConfiguration struct {
// +optional // +optional
CgroupDriver string `json:"cgroupDriver,omitempty"` CgroupDriver string `json:"cgroupDriver,omitempty"`
// cpuManagerPolicy is the name of the policy to use. // cpuManagerPolicy is the name of the policy to use.
// Requires the CPUManager feature gate to be enabled.
// Default: "None" // Default: "None"
// +optional // +optional
CPUManagerPolicy string `json:"cpuManagerPolicy,omitempty"` CPUManagerPolicy string `json:"cpuManagerPolicy,omitempty"`
@ -410,7 +409,6 @@ type KubeletConfiguration struct {
// +optional // +optional
CPUManagerPolicyOptions map[string]string `json:"cpuManagerPolicyOptions,omitempty"` CPUManagerPolicyOptions map[string]string `json:"cpuManagerPolicyOptions,omitempty"`
// cpuManagerReconcilePeriod is the reconciliation period for the CPU Manager. // cpuManagerReconcilePeriod is the reconciliation period for the CPU Manager.
// Requires the CPUManager feature gate to be enabled.
// Default: "10s" // Default: "10s"
// +optional // +optional
CPUManagerReconcilePeriod metav1.Duration `json:"cpuManagerReconcilePeriod,omitempty"` CPUManagerReconcilePeriod metav1.Duration `json:"cpuManagerReconcilePeriod,omitempty"`

View File

@ -267,20 +267,6 @@
lockToDefault: false lockToDefault: false
preRelease: Alpha preRelease: Alpha
version: "1.12" version: "1.12"
- name: CPUManager
versionedSpecs:
- default: false
lockToDefault: false
preRelease: Alpha
version: "1.8"
- default: true
lockToDefault: false
preRelease: Beta
version: "1.10"
- default: true
lockToDefault: true
preRelease: GA
version: "1.26"
- name: CPUManagerPolicyAlphaOptions - name: CPUManagerPolicyAlphaOptions
versionedSpecs: versionedSpecs:
- default: false - default: false