Notice that the kubernetes SLB is eligable for placement
Anything else we need to know?:
Issue tested on version 1.28.4.
The issue lays in how eligability based on selectors are implemented. Currently they only remove SLB's with selectors from the list when that's the case. And in the case of having a service with a label or namespace selector it always returns the complete list of SLB's.
The expected behaviour is that if there's a label match, only the matches SLB's are eligable.
Environment:
Kubernetes version (use kubectl version): 1.26.11
Cloud provider or hardware configuration: Self-managed Kubernetes on Azure with CAPZ
What happened:
Having the below SLB config to distribute Service creation between 3 Azure Load Balancers:
And creating a
Service
with labelapp.kubernetes.io/name: ingress-nginx
makes all 4 SLB configs eligable for placement.What you expected to happen:
Only the SLB configs matching the
ServiceLabelSelector
should be eligable.How to reproduce it (as minimally and precisely as possible):
cloud-controller-manager
with--v=10
or higher (or attach to debugger) 2 .Appy the following manifestskubernetes
SLB is eligable for placementAnything else we need to know?:
Issue tested on version 1.28.4.
The issue lays in how eligability based on selectors are implemented. Currently they only remove SLB's with selectors from the list when that's the case. And in the case of having a service with a label or namespace selector it always returns the complete list of SLB's.
The expected behaviour is that if there's a label match, only the matches SLB's are eligable.
Environment:
kubectl version
): 1.26.11cat /etc/os-release
): Ubuntu 22.04.3 LTSuname -a
): 6.2.0-1017-azure 17~22.04.1-Ubuntu SMP