couldn't validate the identity of the API Server
来源:4-3 用kubespray一键部署生产级k8s集群

慕桂英5256766
2022-09-19
报错:
TASK [kubernetes/control-plane : Joining control plane node to the cluster.] ***************************************************************************************************************************************************************************************
task path: /home/kubespray-2.19.0/roles/kubernetes/control-plane/tasks/kubeadm-secondary.yml:65
fatal: [node1]: FAILED! => {
“attempts”: 3,
“changed”: true,
“cmd”: [
"/usr/local/bin/kubeadm",
“join”,
"–config",
"/etc/kubernetes/kubeadm-controlplane.yaml",
"–ignore-preflight-errors=all",
"–skip-phases="
],
“delta”: “0:05:00.429554”,
“end”: “2022-09-18 18:50:33.074937”,
“invocation”: {
“module_args”: {
"_raw_params": “/usr/local/bin/kubeadm join --config /etc/kubernetes/kubeadm-controlplane.yaml --ignore-preflight-errors=all --skip-phases=”,
"_uses_shell": false,
“argv”: null,
“chdir”: null,
“creates”: null,
“executable”: null,
“removes”: null,
“stdin”: null,
“stdin_add_newline”: true,
“strip_empty_ends”: true,
“warn”: false
}
},
“msg”: “non-zero return code”,
“rc”: 1,
“start”: “2022-09-18 18:45:32.645383”,
“stderr”: “error execution phase preflight: couldn’t validate the identity of the API Server: configmaps “cluster-info” is forbidden: User “system:anonymous” cannot get resource “configmaps” in API group “” in the namespace “kube-public”\nTo see the stack trace of this error execute with --v=5 or higher”,
“stderr_lines”: [
"error execution phase preflight: couldn’t validate the identity of the API Server: configmaps “cluster-info” is forbidden: User “system:anonymous” cannot get resource “configmaps” in API group “” in the namespace “kube-public”",
"To see the stack trace of this error execute with --v=5 or higher"
],
“stdout”: “[preflight] Running pre-flight checks”,
“stdout_lines”: [
"[preflight] Running pre-flight checks"
]
}
"error execution phase preflight: couldn't validate the identity of the API Server: configmaps \"cluster-info\" is forbidden: User \"system:anonymous\" cannot get resource \"configmaps\" in API group \"\" in the namespace \"kube-public\"",
"To see the stack trace of this error execute with --v=5 or higher"
],
大佬请问这种报错的原因?
master:128 node1:129 node2:130
master可以免密登录其他两台节点
报错后,重新执行部署前,需要清除环境之类的操作吗
1回答
-
慕桂英5256766
提问者
2022-09-19
貌似解决了
--become --become-user=root
00
相似问题