I've been struggling for hours trying to get my 3-node HA k3s setup working on fresh installs of Ubuntu 24 on bare metal, and it seems like it should be straightforward. I followed a guide I found online but ran into problems when trying to get additional nodes to join the cluster.
The commands I used to set up the first node are:
1. `curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--write-kubeconfig-mode=644 --disable traefik" K3S_TOKEN=k3stoken sh -s - server --cluster-init`
2. For the other nodes, I tried: `curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--write-kubeconfig-mode=644 --disable traefik" K3S_TOKEN=k3stoken sh -s - server --server https://{hostname/ip}:6443`
However, those nodes don't show up when I run `kubectl` on the first node. I've attempted both hostname and IP for the server connection. I verified the token but it's not working either.
Interestingly, if I set up a basic configuration (without HA), the nodes connect just fine, so it's clearly not a networking problem. Here's the success case:
- Master node connects successfully.
- Worker nodes also appear as expected in `kubectl get nodes`.
Any advice would really be appreciated, as I'm at a loss!
2 Answers
Make sure you're using the correct token format. The token `k3stoken` that you're setting might not be the right one. Try using the token generated during the first installation located at `/var/lib/rancher/k3s/server/token` for the next nodes you want to join.
Check the logs on the nodes that aren't joining. Sometimes those logs can reveal issues that aren't obvious at first. You can find the logs in the `/var/log` directory. Here's a link for more details: [k3s logs FAQ](https://docs.k3s.io/faq#where-are-the-k3s-logs). Good luck!
Related Questions
How To Get Your Domain Unblocked From Facebook
How To Find A String In a Directory of Files Using Linux