kubeadm join --token, Failed to request cluster info

今天想向kubernetes中增加一个节点,利用命令行:

kubeadm join --token c93b06.2cddb224a8931cb3 162.3.160.61:6443

但是加入节点的时候居然报错了,如下:

[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.

[preflight] Running pre-flight checks

[preflight] Starting the kubelet service

[discovery] Trying to connect to API Server "162.3.160.61:6443"

[discovery] Created cluster-info discovery client, requesting info from "https://162.3.160.61:6443"

[discovery] Failed to request cluster info, will try again: [the server has asked for the client to provide credentials (get configmaps cluster-info)]

    [discovery] Failed to request cluster info, will try again: [the server has asked for the client to provide credentials (get configmaps cluster-info)]

[discovery] Failed to request cluster info, will try again: [the server has asked for the client to provide credentials (get configmaps cluster-info)]

[discovery] Failed to request cluster info, will try again: [the server has asked for the client to provide credentials (get configmaps cluster-info)]

[discovery] Failed to request cluster info, will try again: [the server has asked for the client to provide credentials (get configmaps cluster-info)]

[discovery] Failed to request cluster info, will try again: [the server has asked for the client to provide credentials (get configmaps cluster-info)]

[discovery] Failed to request cluster info, will try again: [the server has asked for the client to provide credentials (get configmaps cluster-info)]

 

获取cluster-info获取不到,为什么呢?

Google了很久也没查到具体的原因,难道token过期了?

kubeadm token list

TOKEN TTL EXPIRES USAGES DESCRIPTION

c93b06.2cddb224a8931cb3 <forever> <never> authentication,signing The default bootstrap token generated by 'kubeadm init'.

 

Kubeadm token list 可以看到token没有过期。

为什么为什么为什么?灵光一现,我们在kubeadm部署kubernetes, 部署dashborad不能访问的问题博客中,关闭了匿名访问,是不是这个原因呢?赶快把修改的api-server的启动参数在改回去,如下图所示

重启kubelet, service kubelet restart

再次加入节点

[root@node2 ~]# kubeadm join --token c93b06.2cddb224a8931cb3 162.3.160.61:6443

[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.

[preflight] Running pre-flight checks

[preflight] Starting the kubelet service

[discovery] Trying to connect to API Server "162.3.160.61:6443"

[discovery] Created cluster-info discovery client, requesting info from "https://162.3.160.61:6443"

[discovery] Cluster info signature and contents are valid, will use API Server "https://162.3.160.61:6443"

[discovery] Successfully established connection with API Server "162.3.160.61:6443"

[bootstrap] Detected server version: v1.7.6

[bootstrap] The server supports the Certificates API (certificates.k8s.io/v1beta1)

[csr] Created API client to obtain unique certificate for this node, generating keys and certificate signing request

[csr] Received signed certificate from the API server, generating KubeConfig...

[kubeconfig] Wrote KubeConfig file to disk: "/etc/kubernetes/kubelet.conf"

 

Node join complete:

* Certificate signing request sent to master and response

received.

* Kubelet informed of new secure connection details.

 

Run 'kubectl get nodes' on the master to see this machine join.

 

Oh, yes, 能够正常加入节点了,自己给自己挖的坑啊。

File "/usr/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 282, in get_endpoint 2023-05-22 12:11:00.079 10244 ERROR nova return self.session.get_endpoint(auth or self.auth, **kwargs) 2023-05-22 12:11:00.079 10244 ERROR nova File "/usr/lib/python2.7/site-packages/keystoneauth1/session.py", line 1218, in get_endpoint 2023-05-22 12:11:00.079 10244 ERROR nova return auth.get_endpoint(self, **kwargs) 2023-05-22 12:11:00.079 10244 ERROR nova File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/base.py", line 380, in get_endpoint 2023-05-22 12:11:00.079 10244 ERROR nova allow_version_hack=allow_version_hack, **kwargs) 2023-05-22 12:11:00.079 10244 ERROR nova File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/base.py", line 271, in get_endpoint_data 2023-05-22 12:11:00.079 10244 ERROR nova service_catalog = self.get_access(session).service_catalog 2023-05-22 12:11:00.079 10244 ERROR nova File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/base.py", line 134, in get_access 2023-05-22 12:11:00.079 10244 ERROR nova self.auth_ref = self.get_auth_ref(session) 2023-05-22 12:11:00.079 10244 ERROR nova File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/generic/base.py", line 208, in get_auth_ref 2023-05-22 12:11:00.079 10244 ERROR nova return self._plugin.get_auth_ref(session, **kwargs) 2023-05-22 12:11:00.079 10244 ERROR nova File "/usr/lib/python2.7/site-packages/keystoneauth1/identity/v3/base.py", line 188, in get_auth_ref 2023-05-22 12:11:00.079 10244 ERROR nova authenticated=False, log=False, **rkwargs) 2023-05-22 12:11:00.079 10244 ERROR nova File "/usr/lib/python2.7/site-packages/keystoneauth1/session.py", line 1124, in post 2023-05-22 12:11:00.079 10244 ERROR nova return self.request(url, 'POST', **kwargs) 2023-05-22 12:11:00.079 10244 ERROR nova File "/usr/lib/python2.7/site-packages/keystoneauth1/session.py", line 961, in request 2023-05-22 12:11:00.079 10244 ERROR nova raise exceptions.from_response(resp, method, url) 2023-05-22 12:11:00.079 10244 ERROR nova Unauthorized: The request you have made requires authentication. (HTTP 401) (Request-ID: req-009eabd5-6dd8-42fe-80ea-2fc398
05-26
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

XR风云

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值