在Kubernetes的maste获取node信息提示NotReady
# kubectl get node NAME STATUS ROLES AGE VERSION 192.168.1.65 NotReady <none> 9d v1.13.4 192.168.1.66 Ready <none> 9d v1.13.4
原因node端kubelet启动错误日志显示
Calling handler.OnEndpointsUpda
node端docker也启动失败提示文件不存在
docker.service failed to run 'start' task: No such file or directory
查看docker的systemctl配置文件
# cat /usr/lib/systemd/system/docker.service [Unit] Description=Docker Application Container Engine Documentation=https://docs.docker.com After=network-online.target firewalld.service Wants=network-online.target [Service] Type=notify EnvironmentFile=/run/flannel/subnet.env ExecStart=/usr/bin/dockerd $DOCKER_NETWORK_OPTIONS ExecReload=/bin/kill -s HUP $MAINPID LimitNOFILE=infinity LimitNPROC=infinity LimitCORE=infinity TimeoutStartSec=0 Delegate=yes KillMode=process Restart=on-failure StartLimitBurst=3 StartLimitInterval=60s [Install] WantedBy=multi-user.target
是环境变量文件subnet.env文件不存在原因是网络flanneld没启动,启动即可
systemctl start flanneld systemctl enable flanneld
NotReady原因不是因为docker未启动报错信息如下
Setting node annotation to enable volume controller attach/detach
原因,证书问题,移动node下证书
/opt/kubernetes/ssl
重启kubelet
systemctl daemon-reload systemctl restart kubelet
PS:移动时这个证书不要移动
kubelet-client-2020-03-13-17-19-22.pem
其实证书kubelet-client-current.pem是软链接该证书的