在 kubernetes control plane 服务器上运行 kubeadm certs renew all
命令更新证书后,kubelet 无法正常启动,syslog 在报错信息如下:
"Failed to run kubelet" err="failed to run Kubelet: unable to load bootstrap kubeconfig: stat /etc/kubernetes/bootstrap-kubelet.conf: no such file or directory"
docker ps 命令的输出中无任何容器,请问如何解决这个问题?
kubernetes 版本是 1.23.0
通过 Renew kubernetes pki after expired 的回答中的方法解决了
$ cd /etc/kubernetes/pki/
$ mv {apiserver.crt,apiserver-etcd-client.key,apiserver-kubelet-client.crt,front-proxy-ca.crt,front-proxy-client.crt,front-proxy-client.key,front-proxy-ca.key,apiserver-kubelet-client.key,apiserver.key,apiserver-etcd-client.crt} ~/
$ kubeadm init phase certs all
$ cd /etc/kubernetes/
$ mv {admin.conf,controller-manager.conf,kubelet.conf,scheduler.conf} ~/
$ kubeadm init phase kubeconfig all
$ reboot
$ cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
对于高可用集群,需要加上 control-plane-endpoint 参数
$ kubeadm init phase certs all --control-plane-endpoint "k8s-api:6443"
$ kubeadm init phase kubeconfig all --control-plane-endpoint "k8s-api:6443"