Skip to content

Commit 0ec4740

Browse files
committed
Do not bootstrap etcd-only nodes from existing supervisor
Changes to how we bootstrap the agent and apiserver address list have made this unnecessary since 5014c9e was merged, and it is creating problems due to only etcd-only nodes not using their own config. Signed-off-by: Brad Davidson <[email protected]>
1 parent 0254ca3 commit 0ec4740

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

pkg/cli/server/server.go

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -541,19 +541,14 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont
541541
}
542542

543543
if serverConfig.ControlConfig.DisableAPIServer {
544-
if cfg.ServerURL == "" {
545-
// If this node is the initial member of the cluster and is not hosting an apiserver,
546-
// always bootstrap the agent off local supervisor, and go through the process of reading
547-
// apiserver endpoints from etcd and blocking further startup until one is available.
548-
// This ensures that we don't end up in a chicken-and-egg situation on cluster restarts,
549-
// where the loadbalancer is routing traffic to existing apiservers, but the apiservers
550-
// are non-functional because they're waiting for us to start etcd.
551-
loadbalancer.ResetLoadBalancer(filepath.Join(agentConfig.DataDir, "agent"), loadbalancer.SupervisorServiceName)
552-
} else {
553-
// If this is a secondary member of the cluster and is not hosting an apiserver,
554-
// bootstrap the agent off the existing supervisor, instead of bootstrapping locally.
555-
agentConfig.ServerURL = cfg.ServerURL
556-
}
544+
// If this node is not hosting an apiserver, always bootstrap the agent off the local
545+
// supervisor, and go through the process of reading apiserver endpoints from etcd and
546+
// blocking further startup until one is available. This ensures that we don't end up in
547+
// a chicken-and-egg situation on cluster restarts, where the loadbalancer is routing
548+
// traffic to existing apiservers, but the apiservers are non-functional because they're
549+
// waiting for us to start etcd.
550+
loadbalancer.ResetLoadBalancer(filepath.Join(agentConfig.DataDir, "agent"), loadbalancer.SupervisorServiceName)
551+
557552
// initialize the apiAddress Channel for receiving the api address from etcd
558553
agentConfig.APIAddressCh = make(chan []string)
559554
go getAPIAddressFromEtcd(ctx, serverConfig, agentConfig)

0 commit comments

Comments
 (0)