From 0ec47408e977dce34f1b8044625459e4fcb3defd Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Wed, 13 Aug 2025 18:27:21 +0000 Subject: [PATCH] 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 --- pkg/cli/server/server.go | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/pkg/cli/server/server.go b/pkg/cli/server/server.go index d82a303aa2..b74f9bc1d7 100644 --- a/pkg/cli/server/server.go +++ b/pkg/cli/server/server.go @@ -541,19 +541,14 @@ func run(app *cli.Context, cfg *cmds.Server, leaderControllers server.CustomCont } if serverConfig.ControlConfig.DisableAPIServer { - if cfg.ServerURL == "" { - // If this node is the initial member of the cluster and is not hosting an apiserver, - // always bootstrap the agent off local supervisor, and go through the process of reading - // apiserver endpoints from etcd and blocking further startup until one is available. - // This ensures that we don't end up in a chicken-and-egg situation on cluster restarts, - // where the loadbalancer is routing traffic to existing apiservers, but the apiservers - // are non-functional because they're waiting for us to start etcd. - loadbalancer.ResetLoadBalancer(filepath.Join(agentConfig.DataDir, "agent"), loadbalancer.SupervisorServiceName) - } else { - // If this is a secondary member of the cluster and is not hosting an apiserver, - // bootstrap the agent off the existing supervisor, instead of bootstrapping locally. - agentConfig.ServerURL = cfg.ServerURL - } + // If this node is not hosting an apiserver, always bootstrap the agent off the local + // supervisor, and go through the process of reading apiserver endpoints from etcd and + // blocking further startup until one is available. This ensures that we don't end up in + // a chicken-and-egg situation on cluster restarts, where the loadbalancer is routing + // traffic to existing apiservers, but the apiservers are non-functional because they're + // waiting for us to start etcd. + loadbalancer.ResetLoadBalancer(filepath.Join(agentConfig.DataDir, "agent"), loadbalancer.SupervisorServiceName) + // initialize the apiAddress Channel for receiving the api address from etcd agentConfig.APIAddressCh = make(chan []string) go getAPIAddressFromEtcd(ctx, serverConfig, agentConfig)