Commit 422f5e37 authored by Brendan Burns's avatar Brendan Burns

Add a label which prevents a node from being added to a cloud load balancer.

parent 751bcc47
...@@ -134,6 +134,10 @@ const ( ...@@ -134,6 +134,10 @@ const (
// It's copied over to kubeadm until it's merged in core: https://github.com/kubernetes/kubernetes/pull/39112 // It's copied over to kubeadm until it's merged in core: https://github.com/kubernetes/kubernetes/pull/39112
LabelNodeRoleMaster = "node-role.kubernetes.io/master" LabelNodeRoleMaster = "node-role.kubernetes.io/master"
// LabelNodeRoleExcludeBalancer specifies that the node should be
// exclude from load balancers created by a cloud provider.
LabelNodeRoleExcludeBalancer = "node.role.kubernetes.io/exclude-balancer"
// MasterConfigurationConfigMap specifies in what ConfigMap in the kube-system namespace the `kubeadm init` configuration should be stored // MasterConfigurationConfigMap specifies in what ConfigMap in the kube-system namespace the `kubeadm init` configuration should be stored
MasterConfigurationConfigMap = "kubeadm-config" MasterConfigurationConfigMap = "kubeadm-config"
......
...@@ -598,6 +598,10 @@ func getNodeConditionPredicate() corelisters.NodeConditionPredicate { ...@@ -598,6 +598,10 @@ func getNodeConditionPredicate() corelisters.NodeConditionPredicate {
return false return false
} }
if _, hasExcludeBalancerLabel := node.Labels[constants.LabelNodeRoleExcludeBalancer]; hasExcludeBalancerLabel {
return false
}
// If we have no info, don't accept // If we have no info, don't accept
if len(node.Status.Conditions) == 0 { if len(node.Status.Conditions) == 0 {
return false return false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment