k8s安装异常记录

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
  1. 节点 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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值