Joining a cluster not possible in v1.24
See original GitHub issueSummary
Setting up a fresh cluster according to the docs results in a “Token invalid. (500)” error on the joining node. Building a microk8s cluster is therefore not possible.
What Should Happen Instead?
Joining a cluster using the microk8s join
command generated by the microk8s add-node
from another node should join them together to a cluster.
Reproduction Steps
Tested on:
- Two VMs from DigitalOcean
- Ubuntu 20.04.4 LTS
- Linux node 5.4.0-107-generic 121-Ubuntu SMP Thu Mar 24 16:04:27 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
I was able to reliably reproduce it also on servers from another hoster (Hetzner) and even on Debian 11.
Steps:
- Node A:
snap install microk8s --classic --channel=1.24/stable
- Node B:
echo "10.0.0.3 node-b" >> /etc/hosts
- Node B:
snap install microk8s --classic --channel=1.24/stable
- Node A:
microk8s add-node
- Node B:
microk8s join 10.0.0.2:25000/token/token
Contacting cluster at 10.0.0.2 Connection failed. Invalid token (500)
- Node A:
microk8s kubectl get no
NAME STATUS ROLES AGE VERSION node-a Ready <none> 7m52s v1.24.0-2+59bbb3530b6769
Things I tried:
- Pinging from node B to A works and vice-versa
- Using curl to contact API on node B from A works:
root@node-b:~# curl --insecure -0 https://10.0.0.2:25000 {"error":"Not found"}
- Downgrading to MicroK8s
v1.23.6
on both nodes fixes the issue. Then both connect just fine.
Introspection Report
Can you suggest a fix?
I tested v1.23.6
on the same setup and they connected just fine. Some change between v1.23.6
& v1.24
affects the connectivity or validity of tokens.
Are you interested in contributing with a fix?
No
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Is Your Cluster Ready for v1.24? - Kubernetes
I have a Docker dependency. What now? If your Kubernetes cluster depends on Docker Engine and you intend to upgrade to Kubernetes v1....
Read more >Node cannot join Swarm Cluster - docker - Stack Overflow
24 /swarm/join returned error: Timeout was reached before node was joined. Attempt to join the cluster will continue in the background.
Read more >Release notes - MicroK8s
MicroK8s is a Kubernetes cluster delivered as a single snap package - it can be ... Kubeflow addon not yet available on Kubernetes...
Read more >How To Setup Kubernetes Cluster Using Kubeadm - Easy Guide
Kubeadm is an excellent tool to set up a working kubernetes ... Join the worker node to the master node (control plane) using...
Read more >GKE release notes | Google Kubernetes Engine (GKE)
Not seeing what you're looking for? ... Dataproc. Service for running Apache Spark and Apache Hadoop clusters. ... Join the Partner Advantage program....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi everyone!
Glad to hear this gains traction and sorry for not getting back to @lferran after your initial response. While my command was intended like that and your suggestion didn’t made it work out of the box, but it made something click for me.
After re-testing the steps today (1.24/stable still), I found my issue.
I have to say I’m new to microk8s & k8s in general. The error message I got from node-b:
sounded to me like node-b need to respond with it’s IPv4 when the hostname node-b is pinged. Actually, this error message seems to be generated from node-a’s perspective and only displayed on node-b, then it makes total sense. I was able to resolve the issues mentioned here by making sure every node has a
/etc/hosts
with entries for every node I expect to join the cluster, before joining them together. It’s indeed weird that this was not an issue on 1.23. That definitely contributed to me believing this is a bug in implementation.Here are the entire steps of a clean working setup of 1.24/stable on Ubuntu 20.04.4 LTS:
Node A IPv4:
10.0.0.2
Node B IPv4:10.0.0.3
apt update
apt install snapd
snap install microk8s --classic --channel=1.24/stable
echo "10.0.0.2 node-a" >> /etc/hosts
echo "10.0.0.3 node-b" >> /etc/hosts
echo "10.0.0.2 node-a" >> /etc/hosts
echo "10.0.0.3 node-b" >> /etc/hosts
microk8s add-node
microk8s join 10.0.0.2:25000/token/token
microk8s kubectl get no
:@neoaggelos I can’t really tell much about the inspection reports, sorry. I’ve not tinkered with them or something 🙈
I hope I was able to elaborate on this issue and happy to provide any more info if needed. To me it would be solved at this point, but I would appreciate a mention of this
/etc/hosts
requirement in the setup or troubleshooting documentation. Also because it appears this may affect others as well 🙏Hello, apologies for missing the issue.
@KennethWussmann I am looking at the inspection reports but I see no logs from the microk8s.daemon-cluster-agent service.
Note that if you attempt to
microk8s join
a node and it fails for whatever reason, the token will still be consumed (so you need to create a new one). Alternatively, you can create a token with a specified TTL like so:The token that will be printed by the command can then be used for the next 1 hour.
@TANISSIA2017 @ezequiels This also sounds interesting, but unfortunately I was unable to reproduce the issue with the 1.24 stable branch. Can you provide a few more details as to the situation you encounter? An inspection report would be very useful to have.
Thank you for reporting the issue, I would really like to get to the bottom of this.