Skip to content

Commit 850bfd9

Browse files
authored
Merge pull request kubernetes#126841 from carlory/StableLoadBalancerNodeSet
remove feature-gate StableLoadBalancerNodeSet
2 parents 77737c3 + 295ecc1 commit 850bfd9

File tree

4 files changed

+8
-56
lines changed

4 files changed

+8
-56
lines changed

pkg/features/kube_features.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -772,15 +772,6 @@ const (
772772
// Enables kubelet support to size memory backed volumes
773773
SizeMemoryBackedVolumes featuregate.Feature = "SizeMemoryBackedVolumes"
774774

775-
// owner: @alexanderConstantinescu
776-
// kep: http://kep.k8s.io/3458
777-
// beta: v1.27
778-
// GA: v1.30
779-
//
780-
// Enables less load balancer re-configurations by the service controller
781-
// (KCCM) as an effect of changing node state.
782-
StableLoadBalancerNodeSet featuregate.Feature = "StableLoadBalancerNodeSet"
783-
784775
// owner: @mattcary
785776
// alpha: v1.22
786777
// beta: v1.27
@@ -1183,8 +1174,6 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
11831174

11841175
SizeMemoryBackedVolumes: {Default: true, PreRelease: featuregate.Beta},
11851176

1186-
StableLoadBalancerNodeSet: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.30, remove in 1.32
1187-
11881177
StatefulSetAutoDeletePVC: {Default: true, PreRelease: featuregate.Beta},
11891178

11901179
StatefulSetStartOrdinal: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.31, remove in 1.33

staging/src/k8s.io/cloud-provider/controllers/service/controller.go

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import (
3030
"k8s.io/apimachinery/pkg/util/runtime"
3131
"k8s.io/apimachinery/pkg/util/sets"
3232
"k8s.io/apimachinery/pkg/util/wait"
33-
utilfeature "k8s.io/apiserver/pkg/util/feature"
3433
coreinformers "k8s.io/client-go/informers/core/v1"
3534
clientset "k8s.io/client-go/kubernetes"
3635
"k8s.io/client-go/kubernetes/scheme"
@@ -44,7 +43,6 @@ import (
4443
servicehelper "k8s.io/cloud-provider/service/helpers"
4544
"k8s.io/component-base/featuregate"
4645
controllersmetrics "k8s.io/component-base/metrics/prometheus/controllers"
47-
"k8s.io/controller-manager/pkg/features"
4846
"k8s.io/klog/v2"
4947
)
5048

@@ -439,7 +437,7 @@ func (c *Controller) syncLoadBalancerIfNeeded(ctx context.Context, service *v1.S
439437
}
440438

441439
func (c *Controller) ensureLoadBalancer(ctx context.Context, service *v1.Service) (*v1.LoadBalancerStatus, error) {
442-
nodes, err := listWithPredicates(c.nodeLister, getNodePredicatesForService(service)...)
440+
nodes, err := listWithPredicates(c.nodeLister, stableNodeSetPredicates...)
443441
if err != nil {
444442
return nil, err
445443
}
@@ -701,12 +699,9 @@ func loggableNodeNames(nodes []*v1.Node) []string {
701699

702700
func shouldSyncUpdatedNode(oldNode, newNode *v1.Node) bool {
703701
// Evaluate the individual node exclusion predicate before evaluating the
704-
// compounded result of all predicates. We don't sync changes on the
705-
// readiness condition for eTP:Local services or when
706-
// StableLoadBalancerNodeSet is enabled, hence if a node remains NotReady
707-
// and a user adds the exclusion label we will need to sync as to make sure
708-
// this change is reflected correctly on ETP=local services. The sync
709-
// function compares lastSyncedNodes with the new (existing) set of nodes
702+
// compounded result of all predicates.
703+
//
704+
// The sync function compares lastSyncedNodes with the new (existing) set of nodes
710705
// for each service, so services which are synced with the same set of nodes
711706
// should be skipped internally in the sync function. This is needed as to
712707
// trigger a global sync for all services and make sure no service gets
@@ -718,9 +713,7 @@ func shouldSyncUpdatedNode(oldNode, newNode *v1.Node) bool {
718713
if oldNode.Spec.ProviderID != newNode.Spec.ProviderID {
719714
return true
720715
}
721-
if !utilfeature.DefaultFeatureGate.Enabled(features.StableLoadBalancerNodeSet) {
722-
return respectsPredicates(oldNode, allNodePredicates...) != respectsPredicates(newNode, allNodePredicates...)
723-
}
716+
724717
return false
725718
}
726719

@@ -760,8 +753,8 @@ func (c *Controller) nodeSyncService(svc *v1.Service) bool {
760753
nodeSyncErrorCount.Inc()
761754
return retNeedRetry
762755
}
763-
newNodes = filterWithPredicates(newNodes, getNodePredicatesForService(svc)...)
764-
oldNodes := filterWithPredicates(c.getLastSyncedNodes(svc), getNodePredicatesForService(svc)...)
756+
newNodes = filterWithPredicates(newNodes, stableNodeSetPredicates...)
757+
oldNodes := filterWithPredicates(c.getLastSyncedNodes(svc), stableNodeSetPredicates...)
765758
// Store last synced nodes without actually determining if we successfully
766759
// synced them or not. Failed node syncs are passed off to retries in the
767760
// service queue, so no need to wait. If we don't store it now, we risk
@@ -1011,11 +1004,7 @@ var (
10111004
nodeUnTaintedPredicate,
10121005
nodeReadyPredicate,
10131006
}
1014-
etpLocalNodePredicates []NodeConditionPredicate = []NodeConditionPredicate{
1015-
nodeIncludedPredicate,
1016-
nodeUnTaintedPredicate,
1017-
nodeReadyPredicate,
1018-
}
1007+
10191008
stableNodeSetPredicates []NodeConditionPredicate = []NodeConditionPredicate{
10201009
nodeNotDeletedPredicate,
10211010
nodeIncludedPredicate,
@@ -1028,16 +1017,6 @@ var (
10281017
}
10291018
)
10301019

1031-
func getNodePredicatesForService(service *v1.Service) []NodeConditionPredicate {
1032-
if utilfeature.DefaultFeatureGate.Enabled(features.StableLoadBalancerNodeSet) {
1033-
return stableNodeSetPredicates
1034-
}
1035-
if service.Spec.ExternalTrafficPolicy == v1.ServiceExternalTrafficPolicyLocal {
1036-
return etpLocalNodePredicates
1037-
}
1038-
return allNodePredicates
1039-
}
1040-
10411020
// We consider the node for load balancing only when the node is not labelled for exclusion.
10421021
func nodeIncludedPredicate(node *v1.Node) bool {
10431022
_, hasExcludeBalancerLabel := node.Labels[v1.LabelNodeExcludeBalancers]

staging/src/k8s.io/controller-manager/pkg/features/kube_features.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,6 @@ const (
3737
// alpha: v1.27
3838
// Enable webhook in cloud controller manager
3939
CloudControllerManagerWebhook featuregate.Feature = "CloudControllerManagerWebhook"
40-
41-
// owner: @alexanderConstantinescu
42-
// kep: http://kep.k8s.io/3458
43-
// beta: v1.27
44-
// GA: v1.30
45-
//
46-
// Enables less load balancer re-configurations by the service controller
47-
// (KCCM) as an effect of changing node state.
48-
StableLoadBalancerNodeSet featuregate.Feature = "StableLoadBalancerNodeSet"
4940
)
5041

5142
func SetupCurrentKubernetesSpecificFeatureGates(featuregates featuregate.MutableFeatureGate) error {
@@ -56,5 +47,4 @@ func SetupCurrentKubernetesSpecificFeatureGates(featuregates featuregate.Mutable
5647
// To add a new feature, define a key for it at k8s.io/api/pkg/features and add it here.
5748
var cloudPublicFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
5849
CloudControllerManagerWebhook: {Default: false, PreRelease: featuregate.Alpha},
59-
StableLoadBalancerNodeSet: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // GA in 1.30, remove in 1.31
6050
}

test/featuregates_linter/test_data/unversioned_feature_list.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -760,12 +760,6 @@
760760
lockToDefault: false
761761
preRelease: Beta
762762
version: ""
763-
- name: StableLoadBalancerNodeSet
764-
versionedSpecs:
765-
- default: true
766-
lockToDefault: true
767-
preRelease: GA
768-
version: ""
769763
- name: StatefulSetAutoDeletePVC
770764
versionedSpecs:
771765
- default: true

0 commit comments

Comments
 (0)