当前位置:   article > 正文

K8s集群排错,断电重启The connection to the server apiserver.k8s:6443 was refused - did you specify the right_kubectl did you specify the apiserver.cluster.loca

kubectl did you specify the apiserver.cluster.local

1.断电之后发现集群没有启动起来

The connection to the server apiserver.k8s:6443 was refused - did you specify the right host or port
  • 1

解决方案
1.首先确保Swap 已经关闭
可以采用临时关闭 swapoff -a 但是断电重启之后需要再次设置 也可以设置永久关闭
2各个节点之间防火墙 一定要检查

systemctl stop firewalld
  • 1

3.查看kubelet 服务 是否正常

systemctl status kubelet
  • 1

4.如果一会又不正常了请看详细信息

journalctl -xefu kubelet
  • 1

5.如果发现Unit kubelet.service entered failed state.code=exited, status=255 说明这台节点有污点 ,将污点删除。

  rm -rf /var/lib/kubelet/cpu_manager_state
  • 1

6.排除问题之后 systemctl start kubelet 重启完成
7.查看node ,pod

kubectl get node
kubectl get pods --all-namespaces  
  • 1
  • 2
本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/正经夜光杯/article/detail/929722
推荐阅读
相关标签
  

闽ICP备14008679号