问题描述
我做了 om 主节点的命令
microk8s add-node
From the node you wish to join to this cluster,run the following:
microk8s join 192.168.0.xxx:25000/token
If the node you are adding is not reachable through the default interface you can use one of the following:
microk8s join 192.168.0.yyy:25000/token
microk8s join 192.168.0.xxx:25000/token
microk8s join 172.17.0.1:25000/token
在另一台机器上我做了
microk8s join 192.168.0.xxx:25000/token
Contacting cluster at 192.168.0.xxx
Waiting for this node to finish joining the cluster. .. .. .. .. .. .. .. .. .. ..
它在没有消息的情况下结束,但在主节点命令输出 microk8s.kubectl get no
不显示此节点仅默认节点
解决方法
解决方案可能如@Sultan Zhumatayev所说,将microk8s降级为1.18
,节点将加入并出现在节点列表中。
但是首先要检查问题出在哪里,您可以执行命令:$ microk8s status
和 $ microk8s inspect
进行更深入的检查
另一种可能的解决方案:
1. 如果您打开防火墙 (ufw),请考虑允许所有节点 ip,例如:ufw allow from xxx.xxx.xxx.xxx
(对包括当前节点在内的所有节点重复)。如果您的实例同时具有内部网络和公共网络,它们可能会尝试与错误的实例对话。去掉外部接口后,就可以正常工作了。看看:microk8s-join-stuck。
2. 尝试断开节点与集群的连接。在节点上运行以下命令:
$ sudo microk8s leave
然后你可以尝试再次连接它,通过在主节点上运行 add-node :
$ sudo microk8s add-node
然后再次在节点上执行相应的命令:
$ sudo microk8s join
阅读更多:microk8s-join。
另见:microk8s。