用kubespray 部署的时候提示创建token超时
来源:7-1 定时任务迁移kubernetes

苏赋
2021-06-16
用kubespray 部署的时候提示创建token超时,大佬们帮忙查看一下是什么问题造成的
报错如下:
TASK [kubernetes/master : Create kubeadm token for joining nodes with 24h expiration (default)] ****************************************
task path: /root/kubespray-2.15.0/roles/kubernetes/master/tasks/kubeadm-setup.yml:183
fatal: [k8s-node1 -> 192.168.0.72]: FAILED! => {
“attempts”: 5,
“changed”: false,
“cmd”: [
"/usr/local/bin/kubeadm",
"–kubeconfig",
"/etc/kubernetes/admin.conf",
“token”,
“create”,
"–ttl",
“0”
],
“delta”: “0:01:15.084138”,
“end”: “2021-06-16 16:39:49.491613”,
“invocation”: {
“module_args”: {
"_raw_params": “/usr/local/bin/kubeadm --kubeconfig /etc/kubernetes/admin.conf token create --ttl 0”,
"_uses_shell": false,
“argv”: null,
“chdir”: null,
“creates”: null,
“executable”: null,
“removes”: null,
“stdin”: null,
“stdin_add_newline”: true,
“strip_empty_ends”: true,
“warn”: true
}
},
“msg”: “non-zero return code”,
“rc”: 1,
“start”: “2021-06-16 16:38:34.407475”,
“stderr”: “W0616 16:38:34.484963 5994 configset.go:348] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]\ntimed out waiting for the condition\nTo see the stack trace of this error execute with --v=5 or higher”,
“stderr_lines”: [
“W0616 16:38:34.484963 5994 configset.go:348] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]”,
“timed out waiting for the condition”,
“To see the stack trace of this error execute with --v=5 or higher”
],
“stdout”: “”,
“stdout_lines”: []
}
手动创建token提示超时:
[root@k8s-master kubespray-2.15.0]# /usr/local/bin/kubeadm --kubeconfig /etc/kubernetes/admin.conf token create --ttl 0 --v=5
I0616 16:46:30.636874 6735 token.go:121] [token] validating mixed arguments
I0616 16:46:30.636994 6735 token.go:130] [token] getting Clientsets from kubeconfig file
I0616 16:46:30.641879 6735 token.go:245] [token] loading configurations
I0616 16:46:30.642214 6735 interface.go:400] Looking for default routes with IPv4 addresses
I0616 16:46:30.642232 6735 interface.go:405] Default route transits interface "eth0"
I0616 16:46:30.642366 6735 interface.go:208] Interface eth0 is up
I0616 16:46:30.642474 6735 interface.go:256] Interface “eth0” has 2 addresses :[192.168.0.72/24 fe80::c622:f3a:c460:ae61/64].
I0616 16:46:30.642521 6735 interface.go:223] Checking addr 192.168.0.72/24.
I0616 16:46:30.642539 6735 interface.go:230] IP found 192.168.0.72
I0616 16:46:30.642567 6735 interface.go:262] Found valid IPv4 address 192.168.0.72 for interface “eth0”.
I0616 16:46:30.642584 6735 interface.go:411] Found active IP 192.168.0.72
W0616 16:46:30.647489 6735 configset.go:348] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]
I0616 16:46:30.647522 6735 token.go:252] [token] creating token
timed out waiting for the condition
相似问题