Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

k3s second server node join fail with k3s token #10740

Closed
elszmad opened this issue Aug 22, 2024 · 1 comment
Closed

k3s second server node join fail with k3s token #10740

elszmad opened this issue Aug 22, 2024 · 1 comment

Comments

@elszmad
Copy link

elszmad commented Aug 22, 2024

Environmental Info:
K3s Version:
k3s version v1.30.3+k3s1 (f646604)
go version go1.22.5

Node(s) CPU architecture, OS, and Version:
3 node (HP DL380 Gen10 x86-64)
SLES15SP5

5.14.21-150500.55.73-default #1 SMP PREEMPT_DYNAMIC Tue Aug 6 15:51:33 UTC 2024 (a0ede6a) x86_64 x86_64 x86_64 GNU/Linux

Cluster Configuration:
3 server

Describe the bug:

When using the server token from /var/lib/rancher/k3s/server/token everything is fine, but I want to avoid distrubuting this token for security reasons and I'd like to use bootsrap tokens with TTL.

Steps To Reproduce:

I used k3s token create, this was the generated token:
K106dff6830acfeeb2793f3355c60efc19bba774358b712d8afc9d34c94189d00aa::7v5ir8.zvkkllbsioml6o6x
I tried to join 2nd server with:
install.sh server --server=<first server ip> --node-ip=<second server ip> --tls-san=<additional ip of the second server --token=K106dff6830acfeeb2793f3355c60efc19bba774358b712d8afc9d34c94189d00aa::7v5ir8.zvkkllbsioml6o6x

journalctl -u k3s contains this error:

Aug 22 15:49:00 GIC-MPS-105-203 k3s[7467]: panic: failed to normalize server token; must be in format K10<CA-HASH>::<USERNAME>:<PASSWORD> or <PASSWORD>
Aug 22 15:49:00 GIC-MPS-105-203 k3s[7467]: goroutine 398 [running]:
Aug 22 15:49:00 GIC-MPS-105-203 k3s[7467]: github.com/k3s-io/k3s/pkg/cluster.(*Cluster).Start.func1()
Aug 22 15:49:00 GIC-MPS-105-203 k3s[7467]:         /go/src/github.com/k3s-io/k3s/pkg/cluster/cluster.go:122 +0xc7
Aug 22 15:49:00 GIC-MPS-105-203 k3s[7467]: created by github.com/k3s-io/k3s/pkg/cluster.(*Cluster).Start in goroutine 1
Aug 22 15:49:00 GIC-MPS-105-203 k3s[7467]:         /go/src/github.com/k3s-io/k3s/pkg/cluster/cluster.go:117 +0x588
Aug 22 15:49:00 GIC-MPS-105-203 systemd[1]: k3s.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Aug 22 15:49:00 GIC-MPS-105-203 systemd[1]: k3s.service: Failed with result 'exit-code'.
Aug 22 15:49:00 GIC-MPS-105-203 systemd[1]: Failed to start Lightweight Kubernetes.

  • Installed K3s:

Expected behavior:
k3s token create tokens should work

Actual behavior:
k3s token create tokens does not work

Additional context / logs:

@brandond
Copy link
Contributor

brandond commented Aug 22, 2024

You can't use bootstrap tokens to join servers. Bootstrap tokens can only be used for joining agents. This is covered in the docs at https://docs.k3s.io/cli/token

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done Issue
Development

No branches or pull requests

2 participants