mirror of https://github.com/k3s-io/k3s
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
parent
c0d129003b
commit
8ace8975d2
|
@ -119,7 +119,7 @@ func (p *proxy) SetAPIServerPort(ctx context.Context, port int) error {
|
||||||
p.apiServerURL = u.String()
|
p.apiServerURL = u.String()
|
||||||
p.apiServerEnabled = true
|
p.apiServerEnabled = true
|
||||||
|
|
||||||
if p.lbEnabled {
|
if p.lbEnabled && p.apiServerLB == nil {
|
||||||
lbServerPort := p.lbServerPort
|
lbServerPort := p.lbServerPort
|
||||||
if lbServerPort != 0 {
|
if lbServerPort != 0 {
|
||||||
lbServerPort = lbServerPort - 1
|
lbServerPort = lbServerPort - 1
|
||||||
|
|
Loading…
Reference in New Issue