@@ -85,9 +85,14 @@ const (
8585 // IngressClass specifies which Ingress class we accept
8686 IngressClass = "openstack"
8787
88- // LabelNodeRoleMaster specifies that a node is a master
88+ // LabelNodeExcludeLB specifies that a node should not be used to create a Loadbalancer on
89+ // https://github.com/kubernetes/cloud-provider/blob/25867882d509131a6fdeaf812ceebfd0f19015dd/controllers/service/controller.go#L673
90+ LabelNodeExcludeLB = "node.kubernetes.io/exclude-from-external-load-balancers"
91+
92+ // DepcreatedLabelNodeRoleMaster specifies that a node is a master
8993 // It's copied over to kubeadm until it's merged in core: https://github.com/kubernetes/kubernetes/pull/39112
90- LabelNodeRoleMaster = "node-role.kubernetes.io/master"
94+ // Deprecated in favor of LabelNodeExcludeLB
95+ DeprecatedLabelNodeRoleMaster = "node-role.kubernetes.io/master"
9196
9297 // IngressAnnotationInternal is the annotation used on the Ingress
9398 // to indicate that we want an internal loadbalancer service so that octavia-ingress-controller won't associate
@@ -209,9 +214,13 @@ func getNodeConditionPredicate() NodeConditionPredicate {
209214 return false
210215 }
211216
212- // As of 1.6, we will taint the master, but not necessarily mark it unschedulable.
213- // Recognize nodes labeled as master, and filter them also, as we were doing previously.
214- if _ , hasMasterRoleLabel := node .Labels [LabelNodeRoleMaster ]; hasMasterRoleLabel {
217+ // Recognize nodes labeled as not suitable for LB, and filter them also, as we were doing previously.
218+ if _ , hasExcludeLBRoleLabel := node .Labels [LabelNodeExcludeLB ]; hasExcludeLBRoleLabel {
219+ return false
220+ }
221+
222+ // Deprecated in favor of LabelNodeExcludeLB, kept for consistency and will be removed later
223+ if _ , hasNodeRoleMasterLabel := node .Labels [DeprecatedLabelNodeRoleMaster ]; hasNodeRoleMasterLabel {
215224 return false
216225 }
217226
0 commit comments