Skip to content

Commit a3978d0

Browse files
authored
Merge pull request kubernetes#90823 from smarterclayton/service_load_balancer
Service load balancers should include unschedulable nodes
2 parents 0d82da4 + 1f010cc commit a3978d0

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -635,12 +635,6 @@ func nodeSlicesEqualForLB(x, y []*v1.Node) bool {
635635

636636
func (s *Controller) getNodeConditionPredicate() NodeConditionPredicate {
637637
return func(node *v1.Node) bool {
638-
// We add the master to the node list, but its unschedulable. So we use this to filter
639-
// the master.
640-
if node.Spec.Unschedulable {
641-
return false
642-
}
643-
644638
if s.legacyNodeRoleFeatureEnabled {
645639
// As of 1.6, we will taint the master, but not necessarily mark it unschedulable.
646640
// Recognize nodes labeled as master, and filter them also, as we were doing previously.

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,6 +1379,11 @@ func Test_getNodeConditionPredicate(t *testing.T) {
13791379
input *v1.Node
13801380
want bool
13811381
}{
1382+
{want: false, input: &v1.Node{}},
1383+
{want: true, input: &v1.Node{Status: v1.NodeStatus{Conditions: []v1.NodeCondition{{Type: v1.NodeReady, Status: v1.ConditionTrue}}}}},
1384+
{want: false, input: &v1.Node{Status: v1.NodeStatus{Conditions: []v1.NodeCondition{{Type: v1.NodeReady, Status: v1.ConditionFalse}}}}},
1385+
{want: true, input: &v1.Node{Spec: v1.NodeSpec{Unschedulable: true}, Status: v1.NodeStatus{Conditions: []v1.NodeCondition{{Type: v1.NodeReady, Status: v1.ConditionTrue}}}}},
1386+
13821387
{want: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{}}}},
13831388
{want: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleMaster: ""}}}},
13841389
{want: true, input: &v1.Node{Status: validNodeStatus, ObjectMeta: metav1.ObjectMeta{Labels: map[string]string{labelNodeRoleExcludeBalancer: ""}}}},

0 commit comments

Comments
 (0)