kubernetes 报错The connection to the server localhost:8080 was refused - did you specify the right host or port?
The connection to the server localhost:8080 was refused - did you specify the right host or port?
环境变量
原因:kubernetes master没有与本机绑定,集群初始化的时候没有绑定,此时设置在本机的环境变量即可解决问题。
解决方式
步骤一:设置环境变量
具体根据情况,此处记录linux设置该环境变量
方式一:编辑文件设置
vim /etc/profile
在底部增加新的环境变量 export KUBECONFIG=/etc/kubernetes/admin.conf
方式二:直接追加文件内容
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> /etc/profile
步骤二:使生效
source /etc/profile
解决问题后截图:
sudo kubectl get pods -n kube-system

https://blog.csdn.net/CEVERY/article/details/108753379
kubernetes 报错The connection to the server localhost:8080 was refused - did you specify the right host or port?的更多相关文章
- 使用二进制方式安装K8S时使用kubectl命令报错:The connection to the server localhost:8080 was refused - did you specify the right host or port?
解决思路: kubectl 默认从 ~/.kube/config 配置文件获取访问 kube-apiserver 地址.证书.用户名等信息,如果没有配置该文件,或者该文件个别参数配置出错,执行命令时出 ...
- The connection to the server localhost:8080 was refused - did you specify the right host or port?
The connection to the server localhost:8080 was refused - did you specify the right host or port? 解决 ...
- Kubernetes-kubectl The connection to the server localhost:8080 was refused -did you specify
今天在Kubernetes的从节点上运行命令[kubectl]出现了如下错误: [root@k8snode1 kubernetes]# kubectl get pod The connection t ...
- 【Kubernetes】The connection to the server <master>:6443 was refused - did you specify the right host or port?
不知道怎么用着用着,使用kubectl 时报错,错误如下: root@R740--:~# kubectl get pod The connection to the server 107.105.13 ...
- kubectl error: The connection to the server localhost:8080 was refused
did you run below commands after kubeadm init To start using your cluster, you need to run (as a reg ...
- k8s遇坑:The connection to the server k8s-api.virtual.local:6443 was refused - did you specify the right host or port?
k8s坑The connection to the server localhost:8080 was refused - did you specify the right host or port ...
- k8s节点执行master命令报错 localhost:8080 was refused
首先是按照二进制方式安装的k8s. [root@ht22 calico]# cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) [ ...
- idea启动服务连接mysql后 Navicat连接mysql就报错2013-Lost connection toMySQL server at
我是使用navicat的windows端 连接centos下mysql服务器 第一次常规连接mysql正常,idea启动服务连接mysql后 Navicat连接mysql就报错2013-Lost co ...
- MySQL忘记密码,或:root密码重置报错:mysqladmin: connect to server at 'localhost' failed的解决方案
MySQL root密码重置报错:mysqladmin: connect to server at 'localhost' failed的解决方案 1 登陆失败,mysqladmin修改密码失败 ...
- MySQL 设置root密码报错:mysqladmin: connect to server at 'localhost' failed
MySQL 设置root密码报错:mysqladmin: connect to server at 'localhost' failed 1.安装完MySQL设置root密码报错如下 [root@vm ...
随机推荐
- 前端实现电子签名(web、移动端)通用组件(canvas实现)
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- IDEA Download missing driver files 下载失败解决方法
使用IDEA连接数据库时可能会遇到缺失驱动文件的问题(提示Download missing driver files) 正常情况下点击Download后IDEA会自动下载缺失的文件,但是因为网络原因, ...
- vue2实现tabs侧边导航栏点击内容跳转到对应位置,且内容滚动导航栏切换对应tab
vue2实现tabs侧边导航栏点击内容跳转到对应位置,且内容滚动导航栏切换对应tab 1.tabs使用了 element的插件tabs, 省的自己写滑动动画 2.左侧有用到了 element的插件 N ...
- 学习笔记-Java流程控制
学习来源: [狂神说Java]Java零基础学习视频通俗易懂_哔哩哔哩_bilibili Java流程控制 用户交互Scanner 获取用户的输入 基本语法 Scanner s = new Scann ...
- elementUI中table组件前端自己实现序号排序
<el-table-column type="index" label="序号" width="50" align="cen ...
- Quartz.Net的简单使用
1.安装Quartz.Net Install-Package Quartz -Version 2.5.0 2.需要执行定时任务的代码,新建一个类,继承IJob接口,并实现该接口 public clas ...
- Linux df -h 显示磁盘空间满,但实际未占用满——问题分析
问题现象: 遇到一个问题,在系统上,告警提示磁盘空间不够,如下图所示: 问题分析: 1.首先使用 :du -h / --max-depth=1 命令查看各个目录的占用空间,试图找到占用较多空间的目 ...
- 谷歌是如何改进 GKE、Cloud Run 的 gVisor 文件系统性能的?
灵活的应用程序架构.CI/CD 管道和容器工作负载通常运行不受信任的代码,因此应该与敏感的基础设施隔离.一种常见的解决方案是部署纵深防御产品(如使用gVisor的GKE Sandbox)以通过额外的保 ...
- CAD梦想画图中的“绘图工具——多线段”
CAD软件多线段命令是作为单个平面对象创建的相互连接的线段序列.可以创建直线段.圆弧段或两者的组合线段. 执行方式: (1)单击菜单栏"绘图→多线段".如图: (2)单击绘图工具栏 ...
- 如何为 Debian 11 安装图形用户界面 (GUI)
如何为 Debian 11 安装图形用户界面 (GUI) allway2 于 2021-12-26 17:30:14 发布 11767 收藏 23文章标签: debian 服务器 linux版权 华为 ...