1. kubeadm 执行命令命令错误后 再执行异常
解决:kubeadm reset
![在这里插入图片描述](https://img-blog.csdnimg.cn/907bc5a3920c4c04a2237a872f0b6f5f.png?x-oss-process=image/watermark,type_ZHJvaWRzYW5zZmFsbGJhY2s,shadow_50,text_Q1NETiBAMjA0ODEwMjQ=,size_20,color_FFFFFF,t_70,g_se,x_16)
2. kubectl get cs 查看集群状态
Get “http://127.0.0.1:10251/healthz”: dial tcp 127.0.0.1:10251: connect: connection refused
问题端口未开
解决:
vi /etc/kubernetes/manifests/kube-scheduler.yam #port=0那行注释
3. 节点 kubectl get cs 查看集群状态 unhealth refused
The connection to the server localhost:8080 was refused - did you specify the right host or port?
```bash
[root@VM-16-14-centos ~]# kubectl get pods
The connection to the server localhost:8080 was refused - did you specify the right host or port?
解决
then 所有node
scp 172.21.16.6:/etc/kubernetes/admin.conf /etc/kubernetes/admin.conf
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile
source ~/.bash_profile
- 节点 kubectl get nodes NotReady
● 有问题的节点kubelet的日志
[root@VM-16-6-centos manifests]# journalctl -f -u kubelet
-- Logs begin at Thu 2021-09-02 11:18:04 CST. --
Sep 03 15:40:43 VM-16-6-centos kubelet[832429]: I0903 15:40:43.426645 832429 cni.go:239] "Unable to update cni config" err="no networks found in /etc/cni/net.d"
Sep 03 15:40:44 VM-16-6-centos kubelet[832429]: E0903 15:40:44.159076 832429 kubelet.go:2332] "Container runtime network not ready" networkReady="NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized"
解决 :参考安装的第12安装 Pod 网络附加组件 然后稍等一会 查看集群状态
wget https://docs.projectcalico.org/manifests/calico.yaml
kubectl apply -f calico.yaml
kubectl get pods --all-namespaces #检查 CoreDNS Pod 是否 Running