一、问题

The connection to the server localhost:8080 was refused - did you specify the right host or port?

二、原因

kubectl命令需要使用kubernetes-admin来运行,但是从节点没有这个文件

三、解决方法

1. 主节点将其【/etc/kubernetes/admin.conf】文件拷贝到从节点相同目录下

scp /etc/kubernetes/admin.conf root@192.168.18.133:/etc/kubernetes

2.从节点配置环境变量

echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile

3. 使该文件立即生效

source ~/.bash_profile

4. 接着再运行kubectl命令就OK了

参考:https://www.jianshu.com/p/6fa06b9bbf6a

Kubernetes kubectl The connection to the server localhost:8080 was refused - did you specify the rig相关推荐

  1. k8s重启导致node没有成功连接:The connection to the server localhost:8080 was refused - did you specify the righ

    问题分析 环境变量 原因:kubernetes master没有与本机绑定,集群初始化的时候没有绑定,此时设置在本机的环境变量即可解决问题. 问题图片 解决方式 步骤一:设置环境变量 具体根据情况,此 ...

  2. The connection to the server master:6443 was refused - did you specify the right host or port?

    The connection to the server master:6443 was refused - did you specify the right host or port? kuber ...

  3. 问题解决:The connection to the server xxxxx:6443 was refused - did you specify the right host or port?

    具体排查过程是真的忘了,前后开关了十几个网页. 1.查看kubelet是否正常 systemctl status kubelet 2.kubelet未启动的情况,查看kubelet日志 journal ...

  4. 问题“The connection to the server....:6443 was refused - did you specify the right host or port?”的处理!

    问题"The connection to the server <master>:6443 was refused - did you specify the right hos ...

  5. k8s-问题:[root@master log]# kubectl get node The connection to the server 192.168.0.105:6443 was refus

    记一次测试虚拟机异常关机导致的问题 关于[root@master log]# kubectl get node The connection to the server 192.168.0.105:6 ...

  6. Connection to @localhost failed. [08001] Could not create connection to database server. Attempt

    Connection to @localhost failed. [08001] Could not create connection to database server. Attempt 当我们 ...

  7. k8s The connection to the server 10.209.213.55:443 was refused - did you specify the right host or p

      今天在Kubernetes的从节点上运行命令[kubectl]出现了如下错误 [root@p22650v /home/zhu/k8s]# kubectl create -f k8stranscod ...

  8. python3 mysql错误 pymysql.err.OperationalError: (2013, 'Lost connection to MySQL server during query')

    pymysql错误: pymysql.err.OperationalError: (2013, 'Lost connection to MySQL server during query') pymy ...

  9. JAVA——[MySQLNonTransientConnectionException:Could not create connection to database server.]解决方案

    问题描述 com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connecti ...

  10. stomp 连接错误: Whoops! Lost connection to http://localhost:8080/spring13/stomp 的解决方法

    [0]README 1)本文旨在给出 stomp 连接错误: Whoops! Lost connection to http://localhost:8080/spring13/stomp 的解决方法 ...

最新文章

  1. AppBaseJs 类库 网上常用的javascript函数及其他js类库写的
  2. 算法与数据结构(希尔排序)
  3. intellij idea 2018 license 可用无废话
  4. 【CSS】自定义checkbox样式
  5. 龙芯完成.NET移植稳步推进生态建设
  6. [html] input上传图片怎样触发默认拍照功能?
  7. 需求分析——掌握和使用UML建模语言顺序图模型
  8. cad在布局怎么调比例_大神们都在用的9个CAD制图技巧,你会用几个?
  9. 计算机鼠标不灵活怎么办,电脑鼠标不灵敏怎么调 玩LOL鼠标经常失灵怎么办
  10. 60后即将退休的人,有多少存款就算富有了?
  11. 被“遗弃”的互联网老年人 | 畅言
  12. CSS基础——CSS复合选择器【学习笔记】
  13. Divide Groups(分组)(二分图染色)
  14. 智能陈桥五笔输入法 for linux,陈桥五笔输入法官方下载
  15. 《影响力》顺从心理学6个使人顺从的策略
  16. DSPE-PEG4-Mal分子式:C56H103N2O15P的分子量介绍
  17. deepin系统的安装与问题解决
  18. 快慢缓急总相宜|ONES 人物
  19. 笔记本CPU更换硅脂、液金散热对比测试
  20. 安排几款实用的内网穿透工具(加教程)

热门文章

  1. 十大网络安全策略 打造坚固的内网
  2. 【原】==与isEqual的比较
  3. Linux 防火墙配置
  4. 信息搜集之常见的web组合
  5. Head First设计模式之命令模式
  6. appium python api
  7. 数组累加兼eval性能测试
  8. showModalDialog 的重要提示
  9. 卡尔曼滤波器及代码实现
  10. 孙鑫VC学习笔记:第六讲 菜单