Closed stevensbkang closed 6 months ago
Oh, and here are the k8sd
logs:
root@k8s-perf-opt-m01:~# snap logs k8s.k8sd
2024-04-24T04:02:05Z k8s.k8sd[3446]: 2024/04/24 04:02:05 failed to watch configmap: watch closed
2024-04-24T04:30:35Z k8s.k8sd[3446]: No token exists yet. Creating a new token.
2024-04-24T04:33:16Z k8s.k8sd[3446]: 2024/04/24 04:33:16 failed to watch configmap: watch closed
2024-04-24T05:14:31Z k8s.k8sd[3446]: 2024/04/24 05:14:31 failed to watch configmap: watch closed
2024-04-24T06:05:16Z k8s.k8sd[3446]: 2024/04/24 06:05:16 failed to watch configmap: watch closed
2024-04-24T07:03:45Z k8s.k8sd[3446]: 2024/04/24 07:03:45 failed to watch configmap: watch closed
2024-04-24T07:34:58Z k8s.k8sd[3446]: 2024/04/24 07:34:58 failed to watch configmap: watch closed
2024-04-24T08:07:02Z k8s.k8sd[3446]: 2024/04/24 08:07:02 failed to watch configmap: watch closed
2024-04-24T08:48:46Z k8s.k8sd[3446]: 2024/04/24 08:48:46 failed to watch configmap: watch closed
2024-04-24T09:20:55Z k8s.k8sd[3446]: 2024/04/24 09:20:55 failed to watch configmap: watch closed
Hi @stevensbkang Thanks for raising this. What kind of nodes are you running? VM, LXD container, ...?
Could you try to join the node under a different name?
# on cluster node
sudo k8s get-join-token myworkernode --worker
<token>
# on worker
sudo k8s join-cluster <token> --name myworkernode
By default, k8s join-cluster
will take the hostname to join the cluster. I suspect there is a mismatch between the name set in k8s get-join-token
and the one in k8s join-cluster
.
Ahh, gotcha... I thought the get-join-token
expects one of the manager nodes, but in fact, it is the node name that is joining the cluster. It works as expected now, thanks so much!
Summary
After setting up a cluster of 3 manager nodes successfully, I started adding worker nodes but encountered an error
invalid token
.What Should Happen Instead?
k8s get-join-token ${NODE_NAME} --worker
should come with a valid token so thesudo k8s join-cluster
command works.Reproduction Steps
k8s get-join-token ${NODE_NAME} --worker
to grab the tokensudo k8s join-cluster ${TOKEN}
from a worker nodeError messages below:
For your reference, worker token does not look valid:
System information
Can you suggest a fix?
Not at the moment, need to look at the logic
Are you interested in contributing with a fix?
Yes, I just need to know the guidelines :)