Description
Issue Description
Setting the node.kubernetes.io/exclude-from-external-load-balancers
label to "false"
does not behave as expected. Instead of honoring the boolean value, the controller always excludes the node from the load balancer, regardless of the label’s value.
Impact
In OpenStack’s cloud provider integration, the node-selector
annotation functions as a standard node selector. However, when a node’s labels are updated, the LBaaS service is not automatically reconciled. The only current workaround is to modify the exclude-from-external-load-balancers
label (e.g., adding it with the "false"
value) to trigger reconciliation. This should not impact the node’s inclusion in LBaaS, but instead, it incorrectly excludes the node from the load balancer.
Expected Behavior
The controller should respect the explicit "false"
value and not exclude the node from the load balancer.
Reference
According to the official Kubernetes documentation, only the "true"
value should trigger exclusion. Therefore, the logic should be updated to properly handle the label’s value.
Suggested Fix
Modify the controller logic to explicitly check for "true"
or invalid boolean value rather than treating any presence of the label as exclusionary, e.g.
"" -> exclude (to keep the backwards compatibility)
"true" -> exclude
"foo" -> exclude (to keep the backwards compatibility)
"false" -> include
cloud-provider/controllers/service/controller.go
Lines 1012 to 1016 in 2773935