From d70b31e282f649dc466851bdf6de03e53bc27354 Mon Sep 17 00:00:00 2001 From: Clayton Coleman Date: Mon, 13 Apr 2020 20:58:43 -0400 Subject: [PATCH] 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. --- pkg/controller/service/controller.go | 9 --------- pkg/controller/service/controller_test.go | 2 -- 2 files changed, 11 deletions(-) diff --git a/pkg/controller/service/controller.go b/pkg/controller/service/controller.go index 2cfc08363b1..ccfce3e72d8 100644 --- a/pkg/controller/service/controller.go +++ b/pkg/controller/service/controller.go @@ -70,11 +70,6 @@ const ( // in 1.16 when the ServiceNodeExclusion gate is on. labelNodeRoleExcludeBalancer = "node.kubernetes.io/exclude-from-external-load-balancers" - // labelAlphaNodeRoleExcludeBalancer specifies that the node should be - // exclude from load balancers created by a cloud provider. This label is deprecated and will - // be removed in 1.18. - labelAlphaNodeRoleExcludeBalancer = "alpha.service-controller.kubernetes.io/exclude-balancer" - // serviceNodeExclusionFeature is the feature gate name that // enables nodes to exclude themselves from service load balancers // originated from: https://github.com/kubernetes/kubernetes/blob/28e800245e/pkg/features/kube_features.go#L178 @@ -618,10 +613,6 @@ func getNodeConditionPredicate() NodeConditionPredicate { } } if utilfeature.DefaultFeatureGate.Enabled(serviceNodeExclusionFeature) { - // Will be removed in 1.18 - if _, hasExcludeBalancerLabel := node.Labels[labelAlphaNodeRoleExcludeBalancer]; hasExcludeBalancerLabel { - return false - } if _, hasExcludeBalancerLabel := node.Labels[labelNodeRoleExcludeBalancer]; hasExcludeBalancerLabel { return false } diff --git a/pkg/controller/service/controller_test.go b/pkg/controller/service/controller_test.go index 61433a8ca82..41e822d1eef 100644 --- a/pkg/controller/service/controller_test.go +++ b/pkg/controller/service/controller_test.go @@ -1404,13 +1404,11 @@ func Test_getNodeConditionPredicate(t *testing.T) { {want: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{}}}}, {want: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleMaster: ""}}}}, {want: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleExcludeBalancer: ""}}}}, - {want: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelAlphaNodeRoleExcludeBalancer: ""}}}}, {want: true, enableExclusion: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleMaster: ""}}}}, {want: true, enableLegacy: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleExcludeBalancer: ""}}}}, {want: false, enableLegacy: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleMaster: ""}}}}, - {want: false, enableExclusion: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelAlphaNodeRoleExcludeBalancer: ""}}}}, {want: false, enableExclusion: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleExcludeBalancer: ""}}}}, } for _, tt := range tests {