使用命令sudo kubeadm certs check-expiration查看证书
- 下载
- git clone https://github.com/yuyicai/update-kube-cert.git
cd update-kube-cert
chmod 755 update-kubeadm-cert.sh - 运行certificate
- ./update-kubeadm-cert.sh all --cri docker
- 重启kubelet
- systemctl restart kubelet
- 检查证书更新了吗sudo kubeadm certs check-expiration
还是报错
运行journalctl -xefu kubelet
命令查看systemd日志才发现,错误
复制一个kubelet.conf文件
sudo cp -a /etc/kubernetes/admin.conf /etc/kubernetes/kubelet.conf
sudo systemctl daemon-reload && systemctl restart kubelet
重启
看日志还有问题,进行匿名用户授权即可
sudo kubectl create clusterrolebinding test:anonymous --clusterrole=cluster-admin --user=system:anonymous