Anyone get an k3s agent working going against a k3s server on a network reachable host?
I’ve copied my master node’s /var/lib/rancher/k3s/server/node-token over to the agent node.(I’ve created the below agent1 directory as we have a cluster on this box, I need to run an agent to join a cluster whose master node is a different box). I’ve also copied over the master node’s /etc/rancher/k3s/k3s.yaml to the same agent1 directory.
kubectl --kubeconfig=/var/lib/rancher/k3s/agent1/kube-master.config cluster-info
=> Kubernetes master is running at https://155.246.39.26:6443
So I can perform various kubectl commands listing k8s resources on the master node at 39.26 just fine.
But using the master URL as the agent’s --server URL :
k3s agent --server https://155.246.39.26:6443 --token "
cat /var/lib/rancher/k3s/agent1/cluster_token.dat" --data-dir /var/lib/rancher/k3s/agent1/data --node-label 'worker-node=node2'
I’m getting this error. No idea why as i’m using the token as the documentation indicates what is necessary.
INFO[2020-04-14T10:19:34.593642007-04:00] Starting k3s agent v0.6.1 (7ffe802a)
ERRO[2020-04-14T10:19:34.673690759-04:00] https://155.246.39.26:6443/v1-k3s/config: 401 Unauthorized
Clearly, I’m missing some other piece that’s needed. I’d appreciate any pointers, insights, suggestions.
Thanks,
-steve
– 1st edit –
I meant to include the version info.
Going back to get that, I discovered that the master node is running k3s v1.17.2+k3s1 (cdab19b0) while the agent node has version v0.6.1 (7ffe802a). Clearly this might not be ideal. I’m going to update the agent node’s k3s binary to match the master node & retry.