这里以K8S master端口被拒绝为例
执行kubectl apply -f ... 命令时,出现如下错误
The connection to the server (master主机IP):6443 was refused - did you specify the right host or port?
以下是检查步骤:
- 检查环境变量情况(正常)
# env | grep -i kub
- 检查docker服务(正常)
# systemctl status docker.service
3.检查kubelet服务(表面正常)
# systemctl status kubelet.service
4.查看端口是是否被监听(没有监听)
# netstat -pnlt | grep 6443
5.检查防火墙状态(正常)
# systemctl status firewalld.service
6.查看日志
# journalctl -xeu kubelet
根据日志查询错误,并对应处理
网友评论