Skip to content

Commit d70b31e

Browse files
Remove the legacy load balancer exclusion annotation
alpha.service-controller.kubernetes.io/exclude-balancer is now removed, deployers should use node.kubernetes.io/exclude-from-external-load-balancers.
1 parent 2369ef0 commit d70b31e

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

pkg/controller/service/controller.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ const (
7070
// in 1.16 when the ServiceNodeExclusion gate is on.
7171
labelNodeRoleExcludeBalancer = "node.kubernetes.io/exclude-from-external-load-balancers"
7272

73-
// labelAlphaNodeRoleExcludeBalancer specifies that the node should be
74-
// exclude from load balancers created by a cloud provider. This label is deprecated and will
75-
// be removed in 1.18.
76-
labelAlphaNodeRoleExcludeBalancer = "alpha.service-controller.kubernetes.io/exclude-balancer"
77-
7873
// serviceNodeExclusionFeature is the feature gate name that
7974
// enables nodes to exclude themselves from service load balancers
8075
// originated from: https://github.com/kubernetes/kubernetes/blob/28e800245e/pkg/features/kube_features.go#L178
@@ -618,10 +613,6 @@ func getNodeConditionPredicate() NodeConditionPredicate {
618613
}
619614
}
620615
if utilfeature.DefaultFeatureGate.Enabled(serviceNodeExclusionFeature) {
621-
// Will be removed in 1.18
622-
if _, hasExcludeBalancerLabel := node.Labels[labelAlphaNodeRoleExcludeBalancer]; hasExcludeBalancerLabel {
623-
return false
624-
}
625616
if _, hasExcludeBalancerLabel := node.Labels[labelNodeRoleExcludeBalancer]; hasExcludeBalancerLabel {
626617
return false
627618
}

pkg/controller/service/controller_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,13 +1404,11 @@ func Test_getNodeConditionPredicate(t *testing.T) {
14041404
{want: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{}}}},
14051405
{want: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleMaster: ""}}}},
14061406
{want: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleExcludeBalancer: ""}}}},
1407-
{want: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelAlphaNodeRoleExcludeBalancer: ""}}}},
14081407

14091408
{want: true, enableExclusion: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleMaster: ""}}}},
14101409
{want: true, enableLegacy: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleExcludeBalancer: ""}}}},
14111410

14121411
{want: false, enableLegacy: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleMaster: ""}}}},
1413-
{want: false, enableExclusion: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelAlphaNodeRoleExcludeBalancer: ""}}}},
14141412
{want: false, enableExclusion: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleExcludeBalancer: ""}}}},
14151413
}
14161414
for _, tt := range tests {

0 commit comments

Comments
 (0)