首页 新闻 会员 周边

k8s 集群1台 master 节点出现 NotReady 问题

0
悬赏园豆:30 [已解决问题] 解决于 2020-01-09 19:03

通过 journalctl -u kubelet | tail -n 300 命令查看日志发现下面3个错误:

错误1

cni.go:237] Unable to update cni config: no networks found in /etc/cni/net.d

错误2

Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized

错误3

controller.go:135] failed to ensure node lease exists, will retry in 7s, error: leases.coordination.k8s.io "k8s-master0" is forbidden: User "system:node:blog-swarm-n0" cannot get resource "leases" in API group "coordination.k8s.io" in the namespace "kube-node-lease": can only access node lease with the same name as the requesting node

请问如何解决?

k8s
dudu的主页 dudu | 高人七级 | 园豆:31007
提问于:2020-01-09 18:52
< >
分享
最佳答案
0

是修改 hostname 引起的,错误1与错误2是由于宿主机的 hostname 与节点名称不一致造成 calico-node 容器部署失败,错误3是由于修改了 /etc/kubernetes/kubelet.conf 中的 user: system:node:name: system:node: 中的主机名,都改为相同的名称就解决了。

dudu | 高人七级 |园豆:31007 | 2020-01-09 19:02
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册