Repository: kubernetes-sigs/cloud-provider-azure (go)

Issue:
Configurable TCP Idle timeout limit does not match Azure limit
<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!

If the matter is security related, please disclose it privately via https://kubernetes.io/security/
-->


#### What happened:

Azure [documents](https://learn.microsoft.com/en-us/azure/load-balancer/load-balancer-tcp-reset#configurable-tcp-idle-timeout) that the load balancer tcp idle timeout is configurable between 4 minutes and 100 minutes.

If you use the `service.beta.kubernetes.io/azure-load-balancer-tcp-idle-timeout` annotation on a service, and set the value to 100 minutes, an error is returned saying that the maximum value is 30 mins.

#### What you expected to happen:

100 minute value should be accepted and should be configured for the load balancer managed by the service.

#### How to reproduce it (as minimally and precisely as possible):

#### Anything else we need to know?:

Code to update looks to be here, https://github.com/kubernetes-sigs/cloud-provider-azure/blob/c18b82b3d48b7022455f3e3230af5de7fd4fb1a5/pkg/provider/azure_loadbalancer.go#L2634

#### Environment:

- Kubernetes version (use `kubectl version`):
- Cloud provider or hardware configuration:
- OS (e.g: `cat /etc/os-release`):
- Kernel (e.g. `uname -a`):
- Install tools:
- Network plugin and version (if this is a network-related bug):
- Others:


Pull request:
Increase service idle max timeout to 100 minutes
<!--  Thanks for sending a pull request!  Here are some tips for you:

1. If this is your first time, please read our contributor guidelines: https://git.k8s.io/community/contributors/guide/first-contribution.md#your-first-contribution and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. For reference on required PR/issue labels, read here:
https://git.k8s.io/community/contributors/devel/sig-release/release.md#issuepr-kind-label
3. Ensure you have added or ran the appropriate tests for your PR: https://git.k8s.io/community/contributors/devel/sig-testing/testing.md
4. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews
5. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
-->

#### What type of PR is this?
/kind bug

#### What this PR does / why we need it:

Resolves #4360 by increasing the allowed limit inline with Azures updated limits

#### Which issue(s) this PR fixes:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #4360

#### Special notes for your reviewer:
This limit has been increased on the Azure side and is documented now as 100 minutes maximum, links in the attached issue

#### Does this PR introduce a user-facing change?
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".

For more information on release notes see: https://git.k8s.io/community/contributors/guide/release-notes.md
-->
```release-note
Increase limit for TCP Idle Timeout to 100 minutes
```

#### Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

<!--
This section can be blank if this pull request does not require a release note.

When adding links which point to resources within git repositories, like
KEPs or supporting documentation, please reference a specific commit and avoid
linking directly to the master branch. This ensures that links reference a
specific point in time, rather than a document that may change over time.

See here for guidance on getting permanent links to files: https://help.github.com/en/articles/getting-permanent-links-to-files

Please use the following format for linking documentation:
- [KEP]: <link>
- [Usage]: <link>
- [Other doc]: <link>
-->
```docs

```


Patch:
diff --git a/go.mod b/go.mod
index 0a547c538..aa3b9ec3f 100644
--- a/go.mod
+++ b/go.mod
@@ -27,9 +27,9 @@ require (
 	k8s.io/apimachinery v0.27.4
 	k8s.io/apiserver v0.27.4
 	k8s.io/client-go v0.27.4
-	k8s.io/cloud-provider v0.27.4
+	k8s.io/cloud-provider v0.27.3
 	k8s.io/component-base v0.27.4
-	k8s.io/component-helpers v0.27.4
+	k8s.io/component-helpers v0.27.3
 	k8s.io/controller-manager v0.27.4
 	k8s.io/klog/v2 v2.100.1
 	k8s.io/kubelet v0.27.4
diff --git a/go.sum b/go.sum
index 5868383ca..0075310cc 100644
--- a/go.sum
+++ b/go.sum
@@ -962,12 +962,12 @@ k8s.io/apiserver v0.27.4 h1:ncZ0MBR9yQ/Gf34rtu1EK+HqT8In1YpfAUINu/Akvho=
 k8s.io/apiserver v0.27.4/go.mod h1:GDEFRfFZ4/l+pAvwYRnoSfz0K4j3TWiN4WsG2KnRteE=
 k8s.io/client-go v0.27.4 h1:vj2YTtSJ6J4KxaC88P4pMPEQECWMY8gqPqsTgUKzvjk=
 k8s.io/client-go v0.27.4/go.mod h1:ragcly7lUlN0SRPk5/ZkGnDjPknzb37TICq07WhI6Xc=
-k8s.io/cloud-provider v0.27.4 h1:FkZ1z40+YPm+nEqkojgPbjNQ3QLvU98gsFW3ZbZnrwo=
-k8s.io/cloud-provider v0.27.4/go.mod h1:LpqG1hrNPQQySPWrMrNNNGl79dK0fk/yTkYUlRMoaWU=
+k8s.io/cloud-provider v0.27.3 h1:YylqJpKCB3O2MRnNXshxSVOQTOZE4I0G+cnyOfLwkGA=
+k8s.io/cloud-provider v0.27.3/go.mod h1:+C4rgsL3O0pxXdjoxRDOjCzNTj4C6jYUmK2OyogK1Jw=
 k8s.io/component-base v0.27.4 h1:Wqc0jMKEDGjKXdae8hBXeskRP//vu1m6ypC+gwErj4c=
 k8s.io/component-base v0.27.4/go.mod h1:hoiEETnLc0ioLv6WPeDt8vD34DDeB35MfQnxCARq3kY=
-k8s.io/component-helpers v0.27.4 h1:l1hn/Zx9mWXflo5xz1mo5RRW2g8b6rptWCG7My6rYoE=
-k8s.io/component-helpers v0.27.4/go.mod h1:ayW5btpTdJkVv+CcxhzNRfWT+oPrV6T6qZ1Ay6NEJNI=
+k8s.io/component-helpers v0.27.3 h1:oK7+AlwBKsSUIIRC5Vv8/4HEtmgzXNQD+zLbsOUwVso=
+k8s.io/component-helpers v0.27.3/go.mod h1:uxhXqoWHh4eBVcPj+LKWjtQq0V/vP5ihn4xmf5xNZso=
 k8s.io/controller-manager v0.27.4 h1:iisi3D1AKknVAGgU1dk/HG/UusmBqeS2fCFiRAS0DnE=
 k8s.io/controller-manager v0.27.4/go.mod h1:5+Fo0k+t3MDyuNLjmXzU/dJcD2c34ii8Wef+OmqhkVg=
 k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E=
diff --git a/pkg/azclient/go.mod b/pkg/azclient/go.mod
index 9c6661a20..17aaee2eb 100644
--- a/pkg/azclient/go.mod
+++ b/pkg/azclient/go.mod
@@ -14,7 +14,7 @@ require (
 	github.com/golang/mock v1.6.0
 	github.com/google/uuid v1.3.0
 	github.com/onsi/ginkgo/v2 v2.11.0
-	github.com/onsi/gomega v1.27.10
+	github.com/onsi/gomega v1.27.9
 	go.opentelemetry.io/otel v1.16.0
 	go.opentelemetry.io/otel/trace v1.16.0
 	golang.org/x/crypto v0.11.0
diff --git a/pkg/azclient/go.sum b/pkg/azclient/go.sum
index b8420f2e1..dce70ebd5 100644
--- a/pkg/azclient/go.sum
+++ b/pkg/azclient/go.sum
@@ -56,8 +56,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
 github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
 github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU=
 github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM=
-github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
-github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
+github.com/onsi/gomega v1.27.9 h1:qIyVWbOsvQEye2QCqLsNSeH/5L1RS9vS382erEWfT3o=
+github.com/onsi/gomega v1.27.9/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
 github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
 github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
 github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
diff --git a/pkg/provider/azure_loadbalancer.go b/pkg/provider/azure_loadbalancer.go
index 542f9ff3e..6278e6927 100644
--- a/pkg/provider/azure_loadbalancer.go
+++ b/pkg/provider/azure_loadbalancer.go
@@ -585,7 +585,6 @@ func (az *Cloud) getServiceLoadBalancer(service *v1.Service, clusterName string,
 	}
 
 	// check if the service already has a load balancer
-	var shouldChangeLB bool
 	for i := range existingLBs {
 		existingLB := existingLBs[i]
 
@@ -611,7 +610,6 @@ func (az *Cloud) getServiceLoadBalancer(service *v1.Service, clusterName string,
 		// the current one if the change is needed
 		var err error
 		if wantLb && az.shouldChangeLoadBalancer(service, pointer.StringDeref(existingLB.Name, ""), clusterName, defaultLBName) {
-			shouldChangeLB = true
 			fipConfigNames := []string{}
 			for _, fipConfig := range fipConfigs {
 				fipConfigNames = append(fipConfigNames, pointer.StringDeref(fipConfig.Name, ""))
@@ -645,16 +643,6 @@ func (az *Cloud) getServiceLoadBalancer(service *v1.Service, clusterName string,
 		return selectedLB, status, lbIPsPrimaryPIPs, exists, "", err
 	}
 
-	// If the service moves to a different load balancer, return the one
-	// instead of creating a new load balancer if it exists.
-	if shouldChangeLB {
-		for _, existingLB := range existingLBs {
-			if strings.EqualFold(pointer.StringDeref(existingLB.Name, ""), defaultLBName) {
-				return &existingLB, status, lbIPsPrimaryPIPs, true, deletedLBName, nil
-			}
-		}
-	}
-
 	// create a default LB with meta data if not present
 	if defaultLB == nil {
 		defaultLB = &network.LoadBalancer{
@@ -1594,7 +1582,6 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service,
 			if err != nil {
 				return lb, fmt.Errorf("reconcileLoadBalancer for service (%s): failed to get load balancer %s: %w", serviceName, lbName, err)
 			}
-			addOrUpdateLBInList(&existingLBs, lb)
 		}
 	}
 
@@ -1715,7 +1702,17 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service,
 			}
 			lb = newLB
 
-			addOrUpdateLBInList(&existingLBs, newLB)
+			var found bool
+			for i, existingLB := range existingLBs {
+				if strings.EqualFold(pointer.StringDeref(existingLB.Name, ""), pointer.StringDeref(newLB.Name, "")) {
+					existingLBs[i] = *newLB
+					found = true
+					break
+				}
+			}
+			if !found {
+				existingLBs = append(existingLBs, *newLB)
+			}
 		}
 	}
 
@@ -1766,17 +1763,6 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service,
 	return lb, nil
 }
 
-// addOrUpdateLBInList adds or updates the given lb in the list
-func addOrUpdateLBInList(lbs *[]network.LoadBalancer, targetLB *network.LoadBalancer) {
-	for i, lb := range *lbs {
-		if strings.EqualFold(pointer.StringDeref(lb.Name, ""), pointer.StringDeref(targetLB.Name, "")) {
-			(*lbs)[i] = *targetLB
-			return
-		}
-	}
-	*lbs = append(*lbs, *targetLB)
-}
-
 // removeLBFromList removes the given lb from the list
 func removeLBFromList(lbs *[]network.LoadBalancer, lbName string) {
 	if lbs != nil {
@@ -1850,7 +1836,15 @@ func (az *Cloud) accommodateNodesByPrimaryVMSet(
 		for i := range az.MultipleStandardLoadBalancerConfigurations {
 			multiSLBConfig := az.MultipleStandardLoadBalancerConfigurations[i]
 			if strings.EqualFold(multiSLBConfig.PrimaryVMSet, vmSetName) {
-				foundPrimaryLB := isLBInList(lbs, multiSLBConfig.Name)
+				var foundPrimaryLB bool
+				if lbs != nil {
+					for _, lb := range *lbs {
+						if strings.EqualFold(strings.TrimSuffix(pointer.StringDeref(lb.Name, ""), consts.InternalLoadBalancerNameSuffix), multiSLBConfig.Name) {
+							foundPrimaryLB = true
+							break
+						}
+					}
+				}
 				if !foundPrimaryLB && !strings.EqualFold(strings.TrimSuffix(lbName, consts.InternalLoadBalancerNameSuffix), multiSLBConfig.Name) {
 					klog.V(4).Infof("accommodateNodesByPrimaryVMSet: node(%s) should be on lb(%s) because of primary vmSet (%s), but the lb is not found and will not be created this time, will ignore the primaryVMSet", node.Name, multiSLBConfig.Name, vmSetName)
 					continue
@@ -1901,9 +1895,17 @@ func (az *Cloud) accommodateNodesByNodeSelector(
 					return err
 				}
 				if nodeSelector.Matches(labels.Set(node.Labels)) {
+					var foundLB bool
+					if lbs != nil {
+						for _, lb := range *lbs {
+							if strings.EqualFold(strings.TrimSuffix(pointer.StringDeref(lb.Name, ""), consts.InternalLoadBalancerNameSuffix), multiSLBConfig.Name) {
+								foundLB = true
+								break
+							}
+						}
+					}
 					klog.V(4).Infof("accommodateNodesByNodeSelector: lb(%s) matches node(%s) labels", multiSLBConfig.Name, node.Name)
-					found := isLBInList(lbs, multiSLBConfig.Name)
-					if !found && !strings.EqualFold(strings.TrimSuffix(lbName, consts.InternalLoadBalancerNameSuffix), multiSLBConfig.Name) {
+					if !foundLB && !strings.EqualFold(strings.TrimSuffix(lbName, consts.InternalLoadBalancerNameSuffix), multiSLBConfig.Name) {
 						klog.V(4).Infof("accommodateNodesByNodeSelector: but the lb is not found and will not be created this time, will ignore this load balancer")
 						continue
 					}
@@ -1919,16 +1921,6 @@ func (az *Cloud) accommodateNodesByNodeSelector(
 				}
 			}
 		}
-		// Check if the valid load balancer exists or will exist
-		// after the reconciliation.
-		for i := len(eligibleLBsIDX) - 1; i >= 0; i-- {
-			multiSLBConfig := az.MultipleStandardLoadBalancerConfigurations[eligibleLBsIDX[i]]
-			found := isLBInList(lbs, multiSLBConfig.Name)
-			if !found && !strings.EqualFold(strings.TrimSuffix(lbName, consts.InternalLoadBalancerNameSuffix), multiSLBConfig.Name) {
-				klog.V(4).Infof("accommodateNodesByNodeSelector: the load balancer %s is a valid placement target for node %s, but the lb is not found and will not be created this time, ignore this load balancer", multiSLBConfig.Name, node.Name)
-				eligibleLBsIDX = append(eligibleLBsIDX[:i], eligibleLBsIDX[i+1:]...)
-			}
-		}
 		if idx, ok := nodeNameToLBConfigIDXMap[node.Name]; ok {
 			if IntInSlice(idx, eligibleLBsIDX) {
 				klog.V(4).Infof("accommodateNodesByNodeSelector: node(%s) is already on the eligible lb(%s)", node.Name, az.MultipleStandardLoadBalancerConfigurations[idx].Name)
@@ -1969,18 +1961,6 @@ func (az *Cloud) accommodateNodesByNodeSelector(
 	return nil
 }
 
-// isLBInList checks if the lb is in the list by multipleStandardLoadBalancerConfig name
-func isLBInList(lbs *[]network.LoadBalancer, lbConfigName string) bool {
-	if lbs != nil {
-		for _, lb := range *lbs {
-			if strings.EqualFold(strings.TrimSuffix(pointer.StringDeref(lb.Name, ""), consts.InternalLoadBalancerNameSuffix), lbConfigName) {
-				return true
-			}
-		}
-	}
-	return false
-}
-
 // reconcileMultipleStandardLoadBalancerBackendNodes makes sure the arrangement of nodes
 // across load balancer configurations is expected. This is used in two places:
 // 1. Every time the cloud provide restarts.
@@ -2631,7 +2611,7 @@ func (az *Cloud) getExpectedLoadBalancingRulePropertiesForPort(
 	if lbIdleTimeout, err = consts.Getint32ValueFromK8sSvcAnnotation(service.Annotations, consts.ServiceAnnotationLoadBalancerIdleTimeout, func(val *int32) error {
 		const (
 			min = 4
-			max = 30
+			max = 100
 		)
 		if *val < min || *val > max {
 			return fmt.Errorf("idle timeout value must be a whole number representing minutes between %d and %d, actual value: %d", min, max, *val)
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 283c8a698..2c276b618 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -1254,7 +1254,7 @@ k8s.io/client-go/util/homedir
 k8s.io/client-go/util/keyutil
 k8s.io/client-go/util/retry
 k8s.io/client-go/util/workqueue
-# k8s.io/cloud-provider v0.27.4
+# k8s.io/cloud-provider v0.27.3
 ## explicit; go 1.20
 k8s.io/cloud-provider
 k8s.io/cloud-provider/api
@@ -1305,7 +1305,7 @@ k8s.io/component-base/term
 k8s.io/component-base/tracing
 k8s.io/component-base/tracing/api/v1
 k8s.io/component-base/version
-# k8s.io/component-helpers v0.27.4
+# k8s.io/component-helpers v0.27.3
 ## explicit; go 1.20
 k8s.io/component-helpers/node/util
 # k8s.io/controller-manager v0.27.4


Test patch:
diff --git a/pkg/provider/azure_loadbalancer_test.go b/pkg/provider/azure_loadbalancer_test.go
index 3c0789a3e..db6238f1c 100644
--- a/pkg/provider/azure_loadbalancer_test.go
+++ b/pkg/provider/azure_loadbalancer_test.go
@@ -1656,80 +1656,6 @@ func TestGetServiceTags(t *testing.T) {
 	}
 }
 
-func TestGetServiceLoadBalancerMultiSLB(t *testing.T) {
-	ctrl := gomock.NewController(t)
-	defer ctrl.Finish()
-
-	for _, tc := range []struct {
-		description           string
-		existingLBs           []network.LoadBalancer
-		service               v1.Service
-		multiSLBConfigs       []MultipleStandardLoadBalancerConfiguration
-		expectedLB            *network.LoadBalancer
-		expectedDeletedLBName string
-		expectedError         error
-	}{
-		{
-			description: "should return the existing lb if the service is moved to the lb",
-			existingLBs: []network.LoadBalancer{
-				{
-					Name: pointer.String("lb1-internal"),
-					LoadBalancerPropertiesFormat: &network.LoadBalancerPropertiesFormat{
-						FrontendIPConfigurations: &[]network.FrontendIPConfiguration{
-							{
-								Name: pointer.String("atest1"),
-								ID:   pointer.String("atest1"),
-								FrontendIPConfigurationPropertiesFormat: &network.FrontendIPConfigurationPropertiesFormat{
-									PrivateIPAddress: pointer.String("1.2.3.4"),
-								},
-							},
-						},
-					},
-				},
-				{
-					Name: pointer.String("lb2-internal"),
-				},
-			},
-			service: getInternalTestService("test1"),
-			multiSLBConfigs: []MultipleStandardLoadBalancerConfiguration{
-				{
-					Name: "lb1",
-				},
-				{
-					Name: "lb2",
-					MultipleStandardLoadBalancerConfigurationStatus: MultipleStandardLoadBalancerConfigurationStatus{
-						ActiveServices: sets.Set[string]{"default/test1": sets.Empty{}},
-					},
-				},
-			},
-			expectedDeletedLBName: "lb1-internal",
-			expectedLB: &network.LoadBalancer{
-				Name: pointer.String("lb2-internal"),
-			},
-		},
-	} {
-		t.Run(tc.description, func(t *testing.T) {
-			cloud := GetTestCloud(ctrl)
-			cloud.LoadBalancerSku = "Standard"
-			cloud.MultipleStandardLoadBalancerConfigurations = tc.multiSLBConfigs
-			cloud.plsCache, _ = cloud.newPLSCache()
-			lbClient := mockloadbalancerclient.NewMockInterface(ctrl)
-			lbClient.EXPECT().Delete(gomock.Any(), gomock.Any(), "lb1-internal")
-			cloud.LoadBalancerClient = lbClient
-
-			expectedPLS := make([]network.PrivateLinkService, 0)
-			mockPLSClient := cloud.PrivateLinkServiceClient.(*mockprivatelinkserviceclient.MockInterface)
-			mockPLSClient.EXPECT().List(gomock.Any(), gomock.Any()).Return(expectedPLS, nil)
-
-			lb, _, _, _, deletedLBName, err := cloud.getServiceLoadBalancer(&tc.service, testClusterName,
-				[]*v1.Node{}, true, tc.existingLBs)
-			assert.Equal(t, tc.expectedError, err)
-			assert.Equal(t, tc.expectedLB, lb)
-			assert.Equal(t, tc.expectedDeletedLBName, deletedLBName)
-		})
-	}
-}
-
 func TestGetServiceLoadBalancerCommon(t *testing.T) {
 	testCases := []struct {
 		desc           string
@@ -7325,7 +7251,7 @@ func TestGetEligibleLoadBalancers(t *testing.T) {
 		{
 			description: "should respect label selector",
 			svc:         getTestService("test", v1.ProtocolTCP, nil, false),
-			labels:      map[string]string{"k2": "v2", "k3": "v3"},
+			labels:      map[string]string{"k2": "v2"},
 			lbConfigs: []MultipleStandardLoadBalancerConfiguration{
 				{
 					Name: "a",
@@ -8551,16 +8477,6 @@ func TestReconcileMultipleStandardLoadBalancerNodes(t *testing.T) {
 						},
 					},
 				},
-				{
-					Name: pointer.String("lb4"),
-					LoadBalancerPropertiesFormat: &network.LoadBalancerPropertiesFormat{
-						BackendAddressPools: &[]network.BackendAddressPool{
-							{
-								Name: pointer.String("kubernetes"),
-							},
-						},
-					},
-				},
 			},
 			expectedLBToNodesMap: map[string]sets.Set[string]{
 				"lb1": {"node1": sets.Empty{}},
@@ -8635,16 +8551,6 @@ func TestReconcileMultipleStandardLoadBalancerNodes(t *testing.T) {
 						},
 					},
 				},
-				{
-					Name: pointer.String("lb4"),
-					LoadBalancerPropertiesFormat: &network.LoadBalancerPropertiesFormat{
-						BackendAddressPools: &[]network.BackendAddressPool{
-							{
-								Name: pointer.String("kubernetes"),
-							},
-						},
-					},
-				},
 			},
 			existingNodes: []*v1.Node{
 				getTestNodeWithMetadata("node1", "vmss-1", map[string]string{"k1": "v1"}, "10.1.0.1"),
@@ -8660,64 +8566,6 @@ func TestReconcileMultipleStandardLoadBalancerNodes(t *testing.T) {
 				"lb4": {"node1": sets.Empty{}, "node2": sets.Empty{}, "node6": sets.Empty{}},
 			},
 		},
-		{
-			description: "should skip lbs that do not exist or will not be created when no lb is selected by node selector",
-			existingLBConfigs: []MultipleStandardLoadBalancerConfiguration{
-				{
-					Name: "lb1",
-					MultipleStandardLoadBalancerConfigurationSpec: MultipleStandardLoadBalancerConfigurationSpec{
-						PrimaryVMSet: "vmss-1",
-						NodeSelector: &metav1.LabelSelector{
-							MatchLabels: map[string]string{"k1": "v1"},
-						},
-					},
-				},
-				{
-					Name: "lb2",
-					MultipleStandardLoadBalancerConfigurationSpec: MultipleStandardLoadBalancerConfigurationSpec{
-						PrimaryVMSet: "vmss-2",
-						NodeSelector: &metav1.LabelSelector{
-							MatchLabels: map[string]string{"k2": "v2"},
-						},
-					},
-				},
-				{
-					Name: "lb3",
-					MultipleStandardLoadBalancerConfigurationSpec: MultipleStandardLoadBalancerConfigurationSpec{
-						PrimaryVMSet: "vmss-2",
-						NodeSelector: &metav1.LabelSelector{
-							MatchLabels: map[string]string{"k3": "v3"},
-						},
-					},
-				},
-				{
-					Name: "lb4",
-				},
-			},
-			existingLBs: []network.LoadBalancer{
-				{
-					Name: pointer.String("lb2-internal"),
-					LoadBalancerPropertiesFormat: &network.LoadBalancerPropertiesFormat{
-						BackendAddressPools: &[]network.BackendAddressPool{
-							{Name: pointer.String("kubernetes")},
-						},
-					},
-				},
-			},
-			existingNodes: []*v1.Node{
-				getTestNodeWithMetadata("node1", "vmss-1", map[string]string{"k1": "v1"}, "10.1.0.1"),
-				getTestNodeWithMetadata("node2", "vmss-3", map[string]string{"k3": "v3"}, "10.1.0.2"),
-				getTestNodeWithMetadata("node3", "vmss-3", map[string]string{"k2": "v2"}, "10.1.0.3"),
-				getTestNodeWithMetadata("node5", "vmss-3", map[string]string{"k2": "v2"}, "10.1.0.5"),
-				getTestNodeWithMetadata("node6", "vmss-3", map[string]string{"k3": "v3"}, "10.1.0.6"),
-			},
-			expectedLBToNodesMap: map[string]sets.Set[string]{
-				"lb1": nil,
-				"lb2": {"node3": sets.Empty{}, "node5": sets.Empty{}},
-				"lb3": nil,
-				"lb4": nil,
-			},
-		},
 	} {
 		t.Run(tc.description, func(t *testing.T) {
 			az := GetTestCloud(ctrl)
@@ -8756,79 +8604,3 @@ func getTestNodeWithMetadata(nodeName, vmssName string, labels map[string]string
 		},
 	}
 }
-
-func TestAddOrUpdateLBInList(t *testing.T) {
-	existingLBs := []network.LoadBalancer{
-		{
-			Name: pointer.String("lb1"),
-			LoadBalancerPropertiesFormat: &network.LoadBalancerPropertiesFormat{
-				BackendAddressPools: &[]network.BackendAddressPool{
-					{Name: pointer.String("kubernetes")},
-				},
-			},
-		},
-		{
-			Name: pointer.String("lb2"),
-			LoadBalancerPropertiesFormat: &network.LoadBalancerPropertiesFormat{
-				BackendAddressPools: &[]network.BackendAddressPool{
-					{Name: pointer.String("kubernetes")},
-				},
-			},
-		},
-	}
-	targetLB := network.LoadBalancer{
-		Name: pointer.String("lb1"),
-		LoadBalancerPropertiesFormat: &network.LoadBalancerPropertiesFormat{
-			BackendAddressPools: &[]network.BackendAddressPool{
-				{Name: pointer.String("lb1")},
-			},
-		},
-	}
-	expectedLBs := []network.LoadBalancer{
-		{
-			Name: pointer.String("lb1"),
-			LoadBalancerPropertiesFormat: &network.LoadBalancerPropertiesFormat{
-				BackendAddressPools: &[]network.BackendAddressPool{
-					{Name: pointer.String("lb1")},
-				},
-			},
-		},
-		{
-			Name: pointer.String("lb2"),
-			LoadBalancerPropertiesFormat: &network.LoadBalancerPropertiesFormat{
-				BackendAddressPools: &[]network.BackendAddressPool{
-					{Name: pointer.String("kubernetes")},
-				},
-			},
-		},
-	}
-
-	addOrUpdateLBInList(&existingLBs, &targetLB)
-	assert.Equal(t, expectedLBs, existingLBs)
-
-	targetLB = network.LoadBalancer{
-		Name: pointer.String("lb3"),
-	}
-	expectedLBs = []network.LoadBalancer{
-		{
-			Name: pointer.String("lb1"),
-			LoadBalancerPropertiesFormat: &network.LoadBalancerPropertiesFormat{
-				BackendAddressPools: &[]network.BackendAddressPool{
-					{Name: pointer.String("lb1")},
-				},
-			},
-		},
-		{
-			Name: pointer.String("lb2"),
-			LoadBalancerPropertiesFormat: &network.LoadBalancerPropertiesFormat{
-				BackendAddressPools: &[]network.BackendAddressPool{
-					{Name: pointer.String("kubernetes")},
-				},
-			},
-		},
-		{Name: pointer.String("lb3")},
-	}
-
-	addOrUpdateLBInList(&existingLBs, &targetLB)
-	assert.Equal(t, expectedLBs, existingLBs)
-}
diff --git a/tests/e2e/network/ensureloadbalancer.go b/tests/e2e/network/ensureloadbalancer.go
index 71fbb2663..16b95f586 100644
--- a/tests/e2e/network/ensureloadbalancer.go
+++ b/tests/e2e/network/ensureloadbalancer.go
@@ -673,7 +673,7 @@ var _ = Describe("Ensure LoadBalancer", Label(utils.TestSuiteLabelLB), func() {
 		}
 	})
 
-	It("should support node label `node.kubernetes.io/exclude-from-external-load-balancers`", Label(utils.TestSuiteLabelNonMultiSLB), func() {
+	It("should support node label `node.kubernetes.io/exclude-from-external-load-balancers`", func() {
 		label := "node.kubernetes.io/exclude-from-external-load-balancers"
 		By("Checking the number of the node pools")
 		nodes, err := utils.GetAgentNodes(cs)
diff --git a/tests/e2e/network/multiple_standard_lb.go b/tests/e2e/network/multiple_standard_lb.go
index 37047a3a0..89f2a4218 100644
--- a/tests/e2e/network/multiple_standard_lb.go
+++ b/tests/e2e/network/multiple_standard_lb.go
@@ -105,9 +105,9 @@ var _ = Describe("Ensure LoadBalancer", Label(utils.TestSuiteLabelMultiSLB), fun
 
 		clusterName := os.Getenv("CLUSTER_NAME")
 		lbNameToExpectedVMSetNameMap := map[string]string{
-			clusterName: fmt.Sprintf("%s-mp-0", clusterName),
-			"lb1":       fmt.Sprintf("%s-mp-1", clusterName),
-			"lb2":       fmt.Sprintf("%s-mp-2", clusterName),
+			clusterName: fmt.Sprintf("%s-vmss-0", clusterName),
+			"lb1":       fmt.Sprintf("%s-vmss-1", clusterName),
+			"lb2":       fmt.Sprintf("%s-vmss-2", clusterName),
 		}
 
 		for _, svcIP := range svcIPs {
@@ -166,17 +166,16 @@ var _ = Describe("Ensure LoadBalancer", Label(utils.TestSuiteLabelMultiSLB), fun
 		_, err = waitLBCountEqualTo(tc, interval, timeout, 3, svcIPs)
 		Expect(err).NotTo(HaveOccurred())
 
-		clusterName := os.Getenv("CLUSTER_NAME")
-		By(fmt.Sprintf("Updating service %s to move to another load balancer %s", svc.Name, clusterName))
-		updateServiceAnnotation(svc, map[string]string{"service.beta.kubernetes.io/azure-load-balancer-configurations": clusterName})
+		By(fmt.Sprintf("Updating service %s to move to another load balancer", svc.Name))
+		updateServiceAnnotation(svc, map[string]string{"service.beta.kubernetes.io/azure-load-balancer-configurations": "lb-2"})
 		_, err = cs.CoreV1().Services(ns.Name).Update(context.TODO(), svc, metav1.UpdateOptions{})
 		Expect(err).NotTo(HaveOccurred())
 
 		By("Checking the load balancer count to equal 2")
 		lbNames, err = waitLBCountEqualTo(tc, interval, timeout, 2, svcIPs)
 		Expect(err).NotTo(HaveOccurred())
+		Expect(lbNames.Has("lb-2")).To(BeTrue())
 		Expect(lbNames.Has("lb-1")).To(BeFalse())
-		Expect(lbNames.Has(clusterName)).To(BeTrue())
 	})
 })
 
diff --git a/tests/e2e/utils/network_utils.go b/tests/e2e/utils/network_utils.go
index 27f26794b..7af398a0d 100644
--- a/tests/e2e/utils/network_utils.go
+++ b/tests/e2e/utils/network_utils.go
@@ -255,7 +255,6 @@ func CreateLoadBalancerServiceManifest(name string, annotation map[string]string
 			Name:        name,
 			Namespace:   namespace,
 			Annotations: DeepCopyServiceAnnotation(annotation),
-			Labels:      labels,
 		},
 		Spec: v1.ServiceSpec{
 			Selector:       labels,