Sverre
Sverre

Reputation: 1388

I get a token error when creating k3s cluster (2nd node)

when creating a HA k3s cluster, the first master node goes well, but the second node fails with this error "starting kubernetes: preparing server: bootstrap data already found and encrypted with different token"

I install it like this: curl -sfL https://get.k3s.io | sh -s - server --node-taint CriticalAddonsOnly=true:NoExecute --tls-san 10.0.0.200

when I run the above I got a message like this: [INFO] systemd: Starting k3s Job for k3s.service failed because the control process exited with error code. See "systemctl status k3s.service" and "journalctl -xe" for details.

then when I run journalctl -xe I can see my hint:

"starting kubernetes: preparing server: bootstrap data already found and encrypted with different token"

Upvotes: 0

Views: 5876

Answers (1)

Sverre
Sverre

Reputation: 1388

I found the help in the comments here , it turns out that I need to copy the token from the first node, and use it when I create the 2nd (and 3rd) node like this

  1. on the first node: cat /var/lib/rancher/k3s/server/token
  2. on second node: first cleanup the old failed installation: /usr/local/bin/k3s-uninstall.sh
  3. re-install with token like this: curl -sfL https://get.k3s.io | sh -s - server --node-taint CriticalAddonsOnly=true:NoExecute --tls-san 10.0.0.200 --token K1BBBBBBBBBaa549016::server:f98BBBBBBBBBBBBBa86bbea260 (token is actually different and longer and my IPs are actually a bit different)

Upvotes: 2

Related Questions