mirror of
https://git.vectorsigma.ru/public/k3s.git
synced 2026-07-28 23:49:33 +00:00
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 <brad.davidson@rancher.com>
This commit is contained in:
committed by
Brad Davidson
parent
0254ca3f14
commit
0ec47408e9
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user