mirror of
https://github.com/k0sproject/k0s.git
synced 2026-10-28 11:04:40 +08:00
Previously, k0s only ever used the etcd peer address during local etcd member initialization, either during etcd cluster bootstrap, or when joining a new member into an existing cluster. During k0s startup, allow for the peer address to be changed automatically for single-node clusters. This addresses a design issue in k0s restore where the etcd cluster is restored using either the backed-up etcd peer address or the auto-detected node's peer address if the backed-up node didn't specify one. Without this change, there was no way of restoring a node while also changing the node IP. This is now possible by simply modifying the local k0s config before starting the restored node. Note that this is _only_ done for single-member etcd clusters. For multi-member etcd clusters, the join API performs a basic reachability check before adding a new member, to prevent cluster outages caused by bad configuration values. While this might be doable here as well, it would require significantly more effort, like trying to communicate with the join API, potentially adding a new endpoint. Postpone that decision for now. Signed-off-by: Tom Wieczorek <twieczorek@mirantis.com>