From b656027b9363c4c6dbf4fa634a71d355abd99345 Mon Sep 17 00:00:00 2001 From: Heba Elayoty Date: Wed, 23 Jul 2025 10:52:55 -0700 Subject: [PATCH] Update MaxUnavailableStatefulSet feature gate to beta Signed-off-by: Heba Elayoty --- pkg/apis/apps/types.go | 4 ++-- pkg/features/kube_features.go | 1 + pkg/generated/openapi/zz_generated.openapi.go | 2 +- staging/src/k8s.io/api/apps/v1/generated.proto | 4 ++-- staging/src/k8s.io/api/apps/v1/types.go | 4 ++-- staging/src/k8s.io/api/apps/v1/types_swagger_doc_generated.go | 2 +- .../apps/v1/rollingupdatestatefulsetstrategy.go | 3 +-- .../reference/versioned_feature_list.yaml | 4 ++++ 8 files changed, 14 insertions(+), 10 deletions(-) diff --git a/pkg/apis/apps/types.go b/pkg/apis/apps/types.go index e8e2f5b2eca..fbfb8730951 100644 --- a/pkg/apis/apps/types.go +++ b/pkg/apis/apps/types.go @@ -101,10 +101,10 @@ type RollingUpdateStatefulSetStrategy struct { // The maximum number of pods that can be unavailable during the update. // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). // Absolute number is calculated from percentage by rounding up. This can not be 0. - // Defaults to 1. This field is alpha-level and is only honored by servers that enable the - // MaxUnavailableStatefulSet feature. The field applies to all pods in the range 0 to + // Defaults to 1. This field is beta-level and is enabled by default. The field applies to all pods in the range 0 to // Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it // will be counted towards MaxUnavailable. + // +featureGate=MaxUnavailableStatefulSet // +optional MaxUnavailable *intstr.IntOrString } diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go index c3c7abca6b6..ac799682ff9 100644 --- a/pkg/features/kube_features.go +++ b/pkg/features/kube_features.go @@ -1404,6 +1404,7 @@ var defaultVersionedKubernetesFeatureGates = map[featuregate.Feature]featuregate MaxUnavailableStatefulSet: { {Version: version.MustParse("1.24"), Default: false, PreRelease: featuregate.Alpha}, + {Version: version.MustParse("1.35"), Default: true, PreRelease: featuregate.Beta}, }, MemoryManager: { diff --git a/pkg/generated/openapi/zz_generated.openapi.go b/pkg/generated/openapi/zz_generated.openapi.go index e0e32a3016e..963675c8b2c 100644 --- a/pkg/generated/openapi/zz_generated.openapi.go +++ b/pkg/generated/openapi/zz_generated.openapi.go @@ -8544,7 +8544,7 @@ func schema_k8sio_api_apps_v1_RollingUpdateStatefulSetStrategy(ref common.Refere }, "maxUnavailable": { SchemaProps: spec.SchemaProps{ - Description: "The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding up. This can not be 0. Defaults to 1. This field is alpha-level and is only honored by servers that enable the MaxUnavailableStatefulSet feature. The field applies to all pods in the range 0 to Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it will be counted towards MaxUnavailable.", + Description: "The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding up. This can not be 0. Defaults to 1. This field is beta-level and is enabled by default. The field applies to all pods in the range 0 to Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it will be counted towards MaxUnavailable.", Ref: ref(intstr.IntOrString{}.OpenAPIModelName()), }, }, diff --git a/staging/src/k8s.io/api/apps/v1/generated.proto b/staging/src/k8s.io/api/apps/v1/generated.proto index 5885a62225f..6064110a30d 100644 --- a/staging/src/k8s.io/api/apps/v1/generated.proto +++ b/staging/src/k8s.io/api/apps/v1/generated.proto @@ -581,10 +581,10 @@ message RollingUpdateStatefulSetStrategy { // The maximum number of pods that can be unavailable during the update. // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). // Absolute number is calculated from percentage by rounding up. This can not be 0. - // Defaults to 1. This field is alpha-level and is only honored by servers that enable the - // MaxUnavailableStatefulSet feature. The field applies to all pods in the range 0 to + // Defaults to 1. This field is beta-level and is enabled by default. The field applies to all pods in the range 0 to // Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it // will be counted towards MaxUnavailable. + // +featureGate=MaxUnavailableStatefulSet // +optional optional .k8s.io.apimachinery.pkg.util.intstr.IntOrString maxUnavailable = 2; } diff --git a/staging/src/k8s.io/api/apps/v1/types.go b/staging/src/k8s.io/api/apps/v1/types.go index 4cf54cc99b6..08ed9373cf5 100644 --- a/staging/src/k8s.io/api/apps/v1/types.go +++ b/staging/src/k8s.io/api/apps/v1/types.go @@ -123,10 +123,10 @@ type RollingUpdateStatefulSetStrategy struct { // The maximum number of pods that can be unavailable during the update. // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). // Absolute number is calculated from percentage by rounding up. This can not be 0. - // Defaults to 1. This field is alpha-level and is only honored by servers that enable the - // MaxUnavailableStatefulSet feature. The field applies to all pods in the range 0 to + // Defaults to 1. This field is beta-level and is enabled by default. The field applies to all pods in the range 0 to // Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it // will be counted towards MaxUnavailable. + // +featureGate=MaxUnavailableStatefulSet // +optional MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty" protobuf:"varint,2,opt,name=maxUnavailable"` } diff --git a/staging/src/k8s.io/api/apps/v1/types_swagger_doc_generated.go b/staging/src/k8s.io/api/apps/v1/types_swagger_doc_generated.go index ac54033fd6d..4a4a8a189e0 100644 --- a/staging/src/k8s.io/api/apps/v1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/api/apps/v1/types_swagger_doc_generated.go @@ -285,7 +285,7 @@ func (RollingUpdateDeployment) SwaggerDoc() map[string]string { var map_RollingUpdateStatefulSetStrategy = map[string]string{ "": "RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.", "partition": "Partition indicates the ordinal at which the StatefulSet should be partitioned for updates. During a rolling update, all pods from ordinal Replicas-1 to Partition are updated. All pods from ordinal Partition-1 to 0 remain untouched. This is helpful in being able to do a canary based deployment. The default value is 0.", - "maxUnavailable": "The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding up. This can not be 0. Defaults to 1. This field is alpha-level and is only honored by servers that enable the MaxUnavailableStatefulSet feature. The field applies to all pods in the range 0 to Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it will be counted towards MaxUnavailable.", + "maxUnavailable": "The maximum number of pods that can be unavailable during the update. Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). Absolute number is calculated from percentage by rounding up. This can not be 0. Defaults to 1. This field is beta-level and is enabled by default. The field applies to all pods in the range 0 to Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it will be counted towards MaxUnavailable.", } func (RollingUpdateStatefulSetStrategy) SwaggerDoc() map[string]string { diff --git a/staging/src/k8s.io/client-go/applyconfigurations/apps/v1/rollingupdatestatefulsetstrategy.go b/staging/src/k8s.io/client-go/applyconfigurations/apps/v1/rollingupdatestatefulsetstrategy.go index 0a8a4ec9619..5ab6e7df23e 100644 --- a/staging/src/k8s.io/client-go/applyconfigurations/apps/v1/rollingupdatestatefulsetstrategy.go +++ b/staging/src/k8s.io/client-go/applyconfigurations/apps/v1/rollingupdatestatefulsetstrategy.go @@ -35,8 +35,7 @@ type RollingUpdateStatefulSetStrategyApplyConfiguration struct { // The maximum number of pods that can be unavailable during the update. // Value can be an absolute number (ex: 5) or a percentage of desired pods (ex: 10%). // Absolute number is calculated from percentage by rounding up. This can not be 0. - // Defaults to 1. This field is alpha-level and is only honored by servers that enable the - // MaxUnavailableStatefulSet feature. The field applies to all pods in the range 0 to + // Defaults to 1. This field is beta-level and is enabled by default. The field applies to all pods in the range 0 to // Replicas-1. That means if there is any unavailable pod in the range 0 to Replicas-1, it // will be counted towards MaxUnavailable. MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"` diff --git a/test/compatibility_lifecycle/reference/versioned_feature_list.yaml b/test/compatibility_lifecycle/reference/versioned_feature_list.yaml index 4953bf10750..1ea39807c41 100644 --- a/test/compatibility_lifecycle/reference/versioned_feature_list.yaml +++ b/test/compatibility_lifecycle/reference/versioned_feature_list.yaml @@ -957,6 +957,10 @@ lockToDefault: false preRelease: Alpha version: "1.24" + - default: true + lockToDefault: false + preRelease: Beta + version: "1.34" - name: MemoryManager versionedSpecs: - default: false