zoukankan      html  css  js  c++  java
  • 二进制安装K8S kubctl get node 返回No resources found.解决记录

    [root@k8s-master01 ~]# kubelet --version
    Kubernetes v1.20.0
    
    问题:
    [root@k8s-master01 ~]#  kubctl get node
    No resources found
    [root@k8s-master01 ~]# systemctl status kubelet
    ● kubelet.service - Kubernetes Kubelet
       Loaded: loaded (/usr/lib/systemd/system/kubelet.service; enabled; vendor preset: disabled)
      Drop-In: /etc/systemd/system/kubelet.service.d
               └─10-kubelet.conf
       Active: activating (auto-restart) (Result: exit-code) since Sat 2021-01-30 10:14:16 CST; 2s ago
         Docs: https://github.com/kubernetes/kubernetes
      Process: 27712 ExecStart=/usr/local/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_SYSTEM_ARGS $KUBELET_EXTRA_ARGS (code=exited, status=255)
     Main PID: 27712 (code=exited, status=255)
    
    Jan 30 10:14:16 k8s-master01 kubelet[27712]: net/http.(*persistConn).readLoop(0xc00040c000)
    Jan 30 10:14:16 k8s-master01 kubelet[27712]: /usr/local/go/src/net/http/transport.go:2040 +0x1a8
    Jan 30 10:14:16 k8s-master01 kubelet[27712]: created by net/http.(*Transport).dialConn
    Jan 30 10:14:16 k8s-master01 kubelet[27712]: /usr/local/go/src/net/http/transport.go:1708 +0xcb7
    Jan 30 10:14:16 k8s-master01 kubelet[27712]: goroutine 120 [select]:
    Jan 30 10:14:16 k8s-master01 kubelet[27712]: net/http.(*persistConn).writeLoop(0xc00040c000)
    Jan 30 10:14:16 k8s-master01 kubelet[27712]: /usr/local/go/src/net/http/transport.go:2340 +0x11c
    Jan 30 10:14:16 k8s-master01 kubelet[27712]: created by net/http.(*Transport).dialConn
    Jan 30 10:14:16 k8s-master01 kubelet[27712]: /usr/local/go/src/net/http/transport.go:1709 +0xcdc
    Jan 30 10:14:16 k8s-master01 systemd[1]: kubelet.service failed.
    
    # 原因:kubelet设置的cgroups和docker的不一致导致,修改一样的即可
    我这边修改的是docker
    cat > /etc/docker/daemon.json <<EOF
    {
      "exec-opts": ["native.cgroupdriver=systemd"]
    }
    EOF
    # 修改完需要重启
    [root@k8s-master01 docker]# systemctl restart docker
    [root@k8s-master01 docker]# systemctl restart kubelet
    
  • 相关阅读:
    typeid抛出异常的解释
    [原创]公平数的解法
    [原创]我的北大ACM POJ 1012解答
    [原创]我的PKU ACM POJ1029题解
    asp.net 单用户登录经典解决方案
    [转]SQL事务回滚的问题及其解决的方法
    获取json数据
    js中Date对象的用法
    解决刷新后回到顶部的问题
    C#获取客户端及服务器端主机信息
  • 原文地址:https://www.cnblogs.com/Applogize/p/14348207.html
Copyright © 2011-2022 走看看