有时我们在服务器异常重启以后,部署在上面的k8s执行kubectl命令直接提示
The connection to the server 192.168.1.72:6443 was refused - did you specify the right host or port?
出现这种情况时我们可以先检查kubelet和docker服务的状态,有时我们重启可能需要等一下k8s服务拉起来
如果上述方式还不行,可以尝试重新声明下环境变量
ll /etc/kubernetes/admin.conf echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile source ~/.bash_profile
然后我们再使用kubectl执行命令,发现可以正常返回。
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:https://sulao.cn/post/873
相关阅读
- k8s使用flannel作为CNI网络插件
- k8s中harbor-database-0日志报Permissions should be u=rwx (0700)的处理方法
- k8s使用helm部署harbor镜像仓库并使用nodeport方式暴露
- k8s集群部署prometheus/node-exporter/dcgm-exporter
- k8s中calico匹配多种网络接口名字的方法
- ubuntu22.04使用containerd部署k8s集群
- k8s集群kube-proxy从iptables模式切换到ipvs模式
- k8s级联删除(删除deployment却删除不了rs和pod)异常问题的处理办法
- k8s中修改containerd存储目录并将数据迁移到新磁盘目录
- k8s网络cni插件calico的安装和网络模式切换
评论列表