Why does my single-node RKE2 leader keep failing and switching?
Asked by
TechExplorer42
Hey folks! I'm currently working on an RKE2 cluster with just a single server node that acts as the leader. I have the following line in my `config.yaml` file: `server: https://:9345`. However, I've been facing an issue where, after some time, the leader node stops responding. I get this error message: `Failed to validate connection to cluster at https://127.0.0.1:9345`, along with `rke2-server not listening on port 6443`. This problem leads the agent and other components to try connecting to a different node, making them think the leader is unavailable. Since I don't have HA set up yet and there's no VIP or load balancer, I'm puzzled as to why the leader keeps changing when there's only one node. Any advice on how to stabilize the leader until I can transition to HA mode? Thanks!
Answers
It looks like that line you have is generally meant for the control plane when using multiple nodes. In a single-node setup, that configuration isn't necessary because once you introduce additional nodes, they will utilize the load balancer's IP. When you eventually move to HA, you'll leverage a VIP or LB IP across your control nodes. This should help with leader election among multiple nodes. Hope this clarifies things!
Reply to this answer
Quick question for you โ where are you seeing those specific messages? I think `rke2-server not listening on port 6443` isnโt really logged by rke2. Also, that's related to the apiserver, not the supervising process, which is why it might be confusing.
Reply to this answer
You're right, that line isnโt necessary for a single-node RKE2 cluster. It's only required for joining additional nodes to the cluster, where the `server` option should point to an already functional RKE2 control node. So just keep it simple for now with your single node!
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions