kubelet Error getting node 问题求助

问题现象

master节点采用kubectl 发现资源不存在

[root@k8s-master01 cni]# kubectl get nodes
No resources found
[root@k8s-master01 cni]# kubectl get node
No resources found

寻找原因

发现kubelet的状态虽然是成功,但是报错E0506 03:15:55.794029 4646 kubelet.go:2461] "Error getting node" err="node \"k8s-master01\" not found"

[root@k8s-master01 calico]# systemctl status kubelet -l
● kubelet.service - Kubernetes Kubelet
   Loaded: loaded (/usr/lib/systemd/system/kubelet.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2022-05-06 03:15:50 EDT; 5s ago
     Docs: https://github.com/kubernetes/kubernetes
 Main PID: 4646 (kubelet)
    Tasks: 12
   Memory: 24.7M
   CGroup: /system.slice/kubelet.service
           └─4646 /usr/local/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.kubeconfig --kubeconfig=/etc/kubernetes/kubelet.kubeconfig --config=/etc/kubernetes/kubelet-conf.yml --network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin --container-runtime=remote --runtime-request-timeout=15m --container-runtime-endpoint=unix:///run/containerd/containerd.sock --cgroup-driver=systemd --node-labels=node.kubernetes.io/node=''

May 06 03:15:54 k8s-master01 kubelet[4646]: E0506 03:15:54.988785    4646 kubelet.go:2461] "Error getting node" err="node \"k8s-master01\" not found"
May 06 03:15:55 k8s-master01 kubelet[4646]: E0506 03:15:55.089274    4646 kubelet.go:2461] "Error getting node" err="node \"k8s-master01\" not found"
May 06 03:15:55 k8s-master01 kubelet[4646]: E0506 03:15:55.147196    4646 kubelet_node_status.go:92] "Unable to register node with API server" err="Node \"k8s-master01\" is invalid: metadata.labels: Invalid value: \"''\": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue',  or 'my_value',  or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')" node="k8s-master01"
May 06 03:15:55 k8s-master01 kubelet[4646]: E0506 03:15:55.189399    4646 kubelet.go:2461] "Error getting node" err="node \"k8s-master01\" not found"
May 06 03:15:55 k8s-master01 kubelet[4646]: E0506 03:15:55.290355    4646 kubelet.go:2461] "Error getting node" err="node \"k8s-master01\" not found"
May 06 03:15:55 k8s-master01 kubelet[4646]: E0506 03:15:55.390631    4646 kubelet.go:2461] "Error getting node" err="node \"k8s-master01\" not found"
May 06 03:15:55 k8s-master01 kubelet[4646]: E0506 03:15:55.491190    4646 kubelet.go:2461] "Error getting node" err="node \"k8s-master01\" not found"
May 06 03:15:55 k8s-master01 kubelet[4646]: E0506 03:15:55.592451    4646 kubelet.go:2461] "Error getting node" err="node \"k8s-master01\" not found"
May 06 03:15:55 k8s-master01 kubelet[4646]: E0506 03:15:55.693180    4646 kubelet.go:2461] "Error getting node" err="node \"k8s-master01\" not found"
May 06 03:15:55 k8s-master01 kubelet[4646]: E0506 03:15:55.794029    4646 kubelet.go:2461] "Error getting node" err="node \"k8s-master01\" not found"

初步判断 应该是某个配置中多加了"",被识别多了""

排除网络上的答案

  1. ip地址和主机名没有改变并配置正确

    [root@k8s-master01 cni]# cat /etc/hosts
    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
    192.168.230.81 k8s-master01
    192.168.230.82 k8s-master02
    192.168.230.83 k8s-master03
    192.168.230.84 k8s-node01
    192.168.230.85 k8s-node02
    192.168.230.80 lb01
    192.168.230.90 lb02
    192.168.230.89 lb-vip
    
    
  2. sendbox image 已经配置为阿里云的,非谷歌的

    [root@k8s-master01 cni]# cat /etc/containerd/config.toml | grep sandbox_image
        sandbox_image = "registry.cn-hangzhou.aliyuncs.com/chenby/pause:3.
    
  3. 还有大佬说未安装calico,先安装…emmmm

求各位大佬抱
有问题的伙伴 请看下面的评论: 能解决

  • 0
    点赞
  • 2
    收藏
  • 打赏
    打赏
  • 13
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:数字50 设计师:CSDN官方博客 返回首页
评论 13

打赏作者

�ppppush car

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

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

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

打赏作者

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

抵扣说明:

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

余额充值