k8s集群搭建报错:error:kubectl get csr No resources found.
Posted 王大雏
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了k8s集群搭建报错:error:kubectl get csr No resources found.相关的知识,希望对你有一定的参考价值。
问题
kubectl get csr
No resources found.
原因
因为原来的ssl证书在重启后失效了,不删除的话,即重启kubelet也无法与master通讯
解决方法
node节点
cd /opt/kubernetes/ssl
ls
kubelet-client-2021-04-14-08-41-36.pem kubelet-client-current.pem kubelet.crt kubelet.key
# 删除所有的证书
rm -rf *
# 关闭开启的kubelet
systemctl stop kubelet
master01
kubectl delete clusterrolebinding kubelet-bootstrap
clusterrolebinding.rbac.authorization.k8s.io "kubelet-bootstrap" deleted
kubectl create clusterrolebinding kubelet-bootstrap --clusterrole=system:node-bootstrapper --user=kubelet-bootstrap
clusterrolebinding.rbac.authorization.k8s.io/kubelet-bootstrap created
node节点
#开启kubelet
#node01
bash kubelet.sh 192.168.238.82
#node02
bash kubelet.sh 192.168.238.83
测试成功
master01
kubectl get csr
NAME AGE REQUESTOR CONDITION
node-csr-mJwuqA7DAf4UmB1InN_WEYhFWbQKOqUVXg9Bvc7Intk 4s kubelet-bootstrap Pending
node-csr-ydhzi9EG9M_Ozmbvep0ledwhTCanppStZoq7vuooTq8 11s kubelet-bootstrap Pending
成功!!!
以上是关于k8s集群搭建报错:error:kubectl get csr No resources found.的主要内容,如果未能解决你的问题,请参考以下文章
k8s集群搭建报错:error:kubectl get csr No resources found.
K8S kubeadm 部署出现的故障:kubectl get nodes 节点显示 NotReady