Kubernetes-kubectl The connection to the server localhost:8080 was refused -did you specify
今天在Kubernetes的从节点上运行命令【kubectl】出现了如下错误:
[root@k8snode1 kubernetes]# kubectl get pod The connection to the server localhost:8080 was refused - did you specify the right host or port?
出现这个问题的原因是kubectl命令需要使用kubernetes-admin来运行,解决方法如下,将主节点中的【/etc/kubernetes/admin.conf】文件拷贝到从节点相同目录下,然后如提示配置环境变量:
Your Kubernetes control-plane has initialized successfully!
To start using your cluster, you need to run the following as a regular user:
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
也可以简单方法
echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile
source ~/.bash_profile
接着再运行kubectl命令就OK了
[root@172-19-102-78 ~]# kubectl get cs
NAME STATUS MESSAGE ERROR
scheduler Healthy ok
controller-manager Healthy ok
etcd-0 Healthy {"health":"true"}
Kubernetes-kubectl The connection to the server localhost:8080 was refused -did you specify的更多相关文章
- 使用二进制方式安装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? 解决 ...
- 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 ...
- 【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 ...
- k8s节点执行master命令报错 localhost:8080 was refused
首先是按照二进制方式安装的k8s. [root@ht22 calico]# cat /etc/redhat-release CentOS Linux release 7.9.2009 (Core) [ ...
- 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 ...
- 【kubernetes】kubectl logs connection refused
因为启动dashboard报CrashLoopBackOff错误,尝试使用logs去查看日志,结果报错,错误如下: [root@localhost ~]# kubectl -s http://192. ...
- [nginx] connect() failed (111: Connection refused) while connecting to upstream, client: 101.18.123.107, server: localhost,
nginx一直报错, 2016/12/02 10:23:19 [error] 1472#0: *31 connect() failed (111: Connection refused)while c ...
- 快速解决mysql Lost connection to MySQL server at 'reading initial communication packet及can't connect to mysql server on 'localhost'
今天在使用Navicat连一个远程mysql时,总是提示连接不成功,提示Lost connection to MySQL server at 'reading initial communicatio ...
随机推荐
- 通过自动回复机器人学Mybatis---基础版
第1章 案例简介 介绍要实现的案例情况,后面会通过这个案例来学习 Mybatis 第2章 实战第一部----黎明前的黑暗 在没有 Mybatis 的情况下,使用 Jsp + Servlet + Jdb ...
- JLOI2016 侦查守卫
侦查守卫 小R和B神正在玩一款游戏.这款游戏的地图由 N 个点和 N-1 条无向边组成,每条无向边连接两个点,且地图是连通的.换句话说,游戏的地图是一棵有 N 个节点的树. 游戏中有一种道具叫做侦查守 ...
- IE的F12开发人员工具不显示 转载自:http://blog.csdn.net/longyulu/article/details/8749705
IE的F12开发人员工具不显示问题: 按下F12之后,开发人员工具在桌面上看不到,但是任务栏里有显示.将鼠标放在任务栏的开发人员工具上,出现一片透明的区域,选中之后却出不来.将鼠标移动到开发人员工具的 ...
- crontab踩坑(二):Unit crond.service could not be found.
这是因为Ubuntu上的服务名称是cron不是crond.所以你的命令应该是: sudo service cron start
- Python3-list
list = ['abcd', 786, 2.23, 'runoob', 70.2] tinylist = [123, 'runoob'] print(list) # 输出完整列表 print(lis ...
- CSP-S2019游记——终点
准退役一年了,回来苟CSP,填补去年留下的遗憾,也算是为这个不那么完美的高中OI生涯划一个句点吧. DAY 1 考前:昨天晚上睡得不太好.早上洛谷打卡居然是中吉(3K说的大吉嘞???).在地铁上有点犯 ...
- Python数据抓取(1) —数据处理前的准备
(一)数据抓取概要 为什么要学会抓取网络数据? 对公司或对自己有价值的数据,80%都不在本地的数据库,它们都散落在广大的网络数据,这些数据通常都伴随着网页的形式呈现,这样的数据我们称为非结构化数据 如 ...
- [转载]作为理工科学生,我们为什么要练就好的文笔?我们需要发blog来记录学习历程?
文/JoeyChen 工程师该怎样才能突破自己的能力瓶颈?写 blog! 工程师该怎样精进自己在职涯上所需要的能力?写 blog! 工程师该怎样才能保持学习与成长的动能?写 blog! 工程师该怎样才 ...
- asmlinkage的用法
转自:https://www.cnblogs.com/china_blue/archive/2010/01/15/1648523.html https://blog.csdn.net/liujiaoy ...
- python 鼠标输入
import win32con import win32api import time win32api.SetCursorPos([,]) # 设置鼠标位置 time.sleep(0.1) #win ...