From ad7199a9da850a804188f81565ab72a0b2246fba Mon Sep 17 00:00:00 2001 From: Sergey Kanzhelev Date: Mon, 19 Sep 2022 19:25:16 +0000 Subject: [PATCH] remove podOverhead feature gate as a feature is now GA since 1.24 --- pkg/api/v1/resource/helpers.go | 8 ++++---- pkg/features/kube_features.go | 10 ---------- .../plugins/noderesources/resource_allocation.go | 4 ++-- pkg/scheduler/metrics/resources/resources.go | 2 +- 4 files changed, 7 insertions(+), 17 deletions(-) diff --git a/pkg/api/v1/resource/helpers.go b/pkg/api/v1/resource/helpers.go index 904eb144166..8f77c9a27bd 100644 --- a/pkg/api/v1/resource/helpers.go +++ b/pkg/api/v1/resource/helpers.go @@ -27,7 +27,7 @@ import ( ) // PodRequestsAndLimits returns a dictionary of all defined resources summed up for all -// containers of the pod. If PodOverhead feature is enabled, pod overhead is added to the +// containers of the pod. Pod overhead is added to the // total container resource requests and to the total container limits which have a // non-zero quantity. func PodRequestsAndLimits(pod *v1.Pod) (reqs, limits v1.ResourceList) { @@ -57,7 +57,7 @@ func podRequestsAndLimitsWithoutOverhead(pod *v1.Pod, reqs, limits v1.ResourceLi } // PodRequestsAndLimitsReuse returns a dictionary of all defined resources summed up for all -// containers of the pod. If PodOverhead feature is enabled, pod overhead is added to the +// containers of the pod. Pod overhead is added to the // total container resource requests and to the total container limits which have a // non-zero quantity. The caller may avoid allocations of resource lists by passing // a requests and limits list to the function, which will be cleared before use. @@ -67,7 +67,7 @@ func PodRequestsAndLimitsReuse(pod *v1.Pod, reuseReqs, reuseLimits v1.ResourceLi podRequestsAndLimitsWithoutOverhead(pod, reqs, limits) - // if PodOverhead feature is supported, add overhead for running a pod + // Add overhead for running a pod // to the sum of requests and to non-zero limits: if pod.Spec.Overhead != nil { addResourceList(reqs, pod.Spec.Overhead) @@ -143,7 +143,7 @@ func GetResourceRequestQuantity(pod *v1.Pod, resourceName v1.ResourceName) resou } } - // if PodOverhead feature is supported, add overhead for running a pod + // Add overhead for running a pod // to the total requests if the resource total is non-zero if pod.Spec.Overhead != nil { if podOverhead, ok := pod.Spec.Overhead[resourceName]; ok && !requestQuantity.IsZero() { diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go index 2cb339f8d55..fda0be63165 100644 --- a/pkg/features/kube_features.go +++ b/pkg/features/kube_features.go @@ -630,14 +630,6 @@ const ( // sandbox creation and network configuration completes successfully PodHasNetworkCondition featuregate.Feature = "PodHasNetworkCondition" - // owner: @egernst - // alpha: v1.16 - // beta: v1.18 - // ga: v1.24 - // - // Enables PodOverhead, for accounting pod overheads which are specific to a given RuntimeClass - PodOverhead featuregate.Feature = "PodOverhead" - // owner: @liggitt, @tallclair, sig-auth // alpha: v1.22 // beta: v1.23 @@ -1009,8 +1001,6 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS PodHasNetworkCondition: {Default: false, PreRelease: featuregate.Alpha}, - PodOverhead: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.26 - PodSecurity: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, ProbeTerminationGracePeriod: {Default: true, PreRelease: featuregate.Beta}, // Default to true in beta 1.25 diff --git a/pkg/scheduler/framework/plugins/noderesources/resource_allocation.go b/pkg/scheduler/framework/plugins/noderesources/resource_allocation.go index 48eadc88ff0..6715ccffab2 100644 --- a/pkg/scheduler/framework/plugins/noderesources/resource_allocation.go +++ b/pkg/scheduler/framework/plugins/noderesources/resource_allocation.go @@ -107,8 +107,8 @@ func (r *resourceAllocationScorer) calculateResourceAllocatableRequest(nodeInfo return 0, 0 } -// calculatePodResourceRequest returns the total non-zero requests. If Overhead is defined for the pod and the -// PodOverhead feature is enabled, the Overhead is added to the result. +// calculatePodResourceRequest returns the total non-zero requests. If Overhead is defined for the pod +// the Overhead is added to the result. // podResourceRequest = max(sum(podSpec.Containers), podSpec.InitContainers) + overHead func (r *resourceAllocationScorer) calculatePodResourceRequest(pod *v1.Pod, resource v1.ResourceName) int64 { var podRequest int64 diff --git a/pkg/scheduler/metrics/resources/resources.go b/pkg/scheduler/metrics/resources/resources.go index 931972dec8d..b0286286309 100644 --- a/pkg/scheduler/metrics/resources/resources.go +++ b/pkg/scheduler/metrics/resources/resources.go @@ -177,7 +177,7 @@ func recordMetricWithUnit( } // podRequestsAndLimitsByLifecycle returns a dictionary of all defined resources summed up for all -// containers of the pod. If PodOverhead feature is enabled, pod overhead is added to the +// containers of the pod. Pod overhead is added to the // total container resource requests and to the total container limits which have a // non-zero quantity. The caller may avoid allocations of resource lists by passing // a requests and limits list to the function, which will be cleared before use.