From 8ace8975d293bf6eb46e27d207fb667a47d282a5 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Mon, 8 Mar 2021 15:47:14 -0800 Subject: [PATCH] Don't start up multiple apiserver load balancers get() is called in a loop until client configuration is successfully retrieved. Each iteration will try to configure the apiserver proxy, which will in turn create a new load balancer. Skip creating a new load balancer if we already have one. Signed-off-by: Brad Davidson --- pkg/agent/proxy/apiproxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/agent/proxy/apiproxy.go b/pkg/agent/proxy/apiproxy.go index f1c7a916ee..2d0503fcb4 100644 --- a/pkg/agent/proxy/apiproxy.go +++ b/pkg/agent/proxy/apiproxy.go @@ -119,7 +119,7 @@ func (p *proxy) SetAPIServerPort(ctx context.Context, port int) error { p.apiServerURL = u.String() p.apiServerEnabled = true - if p.lbEnabled { + if p.lbEnabled && p.apiServerLB == nil { lbServerPort := p.lbServerPort if lbServerPort != 0 { lbServerPort = lbServerPort - 1