From ee8f9f26b91fd391eff6a7abb67f698904bd6115 Mon Sep 17 00:00:00 2001 From: Matt Martin Date: Fri, 10 Jul 2020 08:58:46 -0500 Subject: [PATCH] Skip ensuring VMSS in pool for nodes which should be excluded from lb Such nodes should not be added to backend pools. This has particular impact for nodes which are not master nodes (such as nodes running an etcd cluster) and are incorrectly added to the pool prior to this change. --- .../src/k8s.io/legacy-cloud-providers/azure/azure_vmss.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss.go b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss.go index 68af42568fa..9831bf0e7da 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss.go +++ b/staging/src/k8s.io/legacy-cloud-providers/azure/azure_vmss.go @@ -954,6 +954,12 @@ func (ss *scaleSet) ensureVMSSInPool(service *v1.Service, nodes []*v1.Node, back if ss.excludeMasterNodesFromStandardLB() && isMasterNode(node) { continue } + + if ss.ShouldNodeExcludedFromLoadBalancer(node) { + klog.V(4).Infof("Excluding unmanaged/external-resource-group node %q", node.Name) + continue + } + // in this scenario the vmSetName is an empty string and the name of vmss should be obtained from the provider IDs of nodes resourceGroupName, vmssName, err := getVmssAndResourceGroupNameByVMProviderID(node.Spec.ProviderID) if err != nil {