Browse Source

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 <brad.davidson@rancher.com>
pull/3039/head
Brad Davidson 4 years ago committed by Brad Davidson
parent
commit
8ace8975d2
  1. 2
      pkg/agent/proxy/apiproxy.go

2
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

Loading…
Cancel
Save