【kubernetes】kubectl logs connection refused
因为启动dashboard报CrashLoopBackOff错误,尝试使用logs去查看日志,结果报错,错误如下:
[root@localhost ~]# kubectl -s http://192.168.37.130:8080 logs kubernetes-dashboard-v1.4.0-vceyf --namespace=kube-system
Using HTTP port:
Using apiserver-host location: http://127.0.0.1:8080
Creating API server client for http://127.0.0.1:8080
Error while initializing connection to Kubernetes apiserver. This most likely means that the cluster is misconfigured (e.g., it has invalid apiserver certificates or service accounts configuration) or the --apiserver-host param points to a server that does not exist. Reason: Get http://127.0.0.1:8080/version: dial tcp 127.0.0.1:8080: getsockopt: connection refused
但是使用curl http://192.168.37.130:8080却是可以访问通的
[root@localhost ~]# curl http://192.168.37.130:8080
{
"paths": [
"/api",
"/api/v1",
...."/version"
]
}[root@localhost ~]#
实在很奇怪,
首先怀疑是不是因为IPV6的原因导致,关闭IPV6
编辑文件/etc/sysctl.conf,
vi /etc/sysctl.conf
添加下面的行:
net.ipv6.conf.all.disable_ipv6 =
net.ipv6.conf.default.disable_ipv6 =
如果你想要为特定的网卡禁止IPv6,比如,对于enp0s3,添加下面的行。
net.ipv6.conf.enp0s3.disable_ipv6 =
保存并退出文件。
执行下面的命令来使设置生效。
sysctl -p
但再次重启服务,也还是无法访问,原因不在此。
从网上看这篇文章:http://blog.csdn.net/qingchi0/article/details/42538549,说
监听的接口,如果配置为127.0.0.1则只监听localhost,配置为0.0.0.0会监听所有接口,这里配置为0.0.0.0。
尝试进行修改
把前文安装kube-apiserver的配置文件/etc/sysconfig/kubernets/kube-apiserver修改为
INSECURE_BIND_ADDRESS="--insecure-bind-address=0.0.0.0"
重启服务,发现这次连本来能访问的localhost:8080都访问不通了,说明无效,再次尝试将INSECURE_BIND_ADDRESS改为
INSECURE_BIND_ADDRESS="--address=0.0.0.0"
重启服务,
curl 127.0.0.1:8080
curl localhost:8080
curl 192.168.37.130:8080
三种方式访问都么有问题。
本以为按照127.0.0.1能够访问通了,kubectl -s http://192.168.37.130:8080 logs kubernetes-dashboard-v1.4.0-vceyf --namespace=kube-system就能看到结果了,但结果依旧,那么就应该是提示中的另外一个问题了,
This most likely means that the cluster is misconfigured (e.g., it has invalid apiserver certificates or service accounts configuration)
这个就应该是证书的问题了,这个问题比较复杂,后面在系统的去研究下
【kubernetes】kubectl logs connection refused的更多相关文章
- 【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 ...
- 【Kubernetes】kube-dns 持续重启
kuberbetes部署和启动正常,但是kube-dns持续重启 使用命令 kubectl get pods --all-namespaces 得到结果 从图中可以看出kube-dns-c7d8589 ...
- 【原创】<Debug> “duplicate connection name”
[Problem] duplicate connection name [Solution] 在Qt上使用SQLite的时候,如果第二次使用QSqlDatabase::addDatabase()方式时 ...
- 【Kubernetes】离线业务:Job与CronJob
Deployment.StatefulSet和DaemonSet这三个编排概念编排的对象主要都是在线业务(Long Running Task,这些应用一旦运行起来,除非出错或者停止,它的容器进程会一直 ...
- 【Kubernetes】容器集群管理常用命令笔记
一.集群部署-查询集群状态 ①查询k8s master各组件健康状态: kubectl get componentstatus ②查询k8s node健康状态: kubectl get node 二. ...
- 【Kubernetes】两篇文章 搞懂 K8s 的 fannel 网络原理
近期公司的flannel网络很不稳定,花时间研究了下并且保证云端自动部署的网络能够正常work. 1.网络拓扑 拓扑如下:(点开看大图) 容器网卡通过docker0桥接到flannel0网卡,而每个 ...
- 【Kubernetes】部署K8s-dashboard v1.10.1
一.官方kubernetes-dashboard.yaml简介 ①首先认识一下官方的kubernetes-dashboard.yaml,我们先下载: https://github.com/kubern ...
- 37 【kubernetes】搭建dashboard
官方的操作步骤是:https://github.com/kubernetes/dashboard 我自己的步骤是: 1,下载yaml文件 wget https://raw.githubusercont ...
- 36 【kubernetes】coredns
CoreDNS是k8s中,master节点和从节点及其pods之间通信的接口. 但是上个博客中遇到一个问题dns一直处于crush的状态. https://www.cnblogs.com/helww/ ...
随机推荐
- LeetCode OJ:Bulls and Cows (公牛与母牛)
You are playing the following Bulls and Cows game with your friend: You write down a number and ask ...
- 正则表达式 preg_match 匹配中文
preg_match 匹配中文出错 2010年01月06日 星期三 14:55 错误提示: Warning: preg_match() [function.preg-match]: Compilati ...
- vue.js 源代码学习笔记 ----- core array.js
/* * not type checking this file because flow doesn't play well with * dynamically accessing methods ...
- c# 多线程调用窗体上的控件 示例
private delegate void InvokeCallback(string msg); private void SetCountValue(string s) { if (this.fo ...
- 配置mysql 允许远程连接
今天折腾了好常时间远程连接mysql ,在云服务器里面打开了3306端口,使用了service mysql status查看到mysql进程正常. netstat -anp | grep mysql ...
- dpkg: 处理归档 /var/cache/apt/archives/swig2.0_2.0.12-1ubuntu4_amd64.deb (--unpack)时出错:
问题: sudo apt-get upgrade 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... 完成 正在计算更新... 完成下列软件包的版本将保持不变: lib ...
- Android 开发 Tip 17 -- 为什么getBackground().setAlpha(); 会影响别的控件?
转载请注明出处:http://blog.csdn.net/crazy1235/article/details/75670018 http://www.jb51.net/article/110035.h ...
- Java中级面试题——(上)
List和Set比较,各自的子类比较 对比一:Arraylist与LinkedList的比较 1.ArrayList是实现了基于动态数组的数据结构,因为地址连续,一旦数据存储好了,查询操作效率会比较高 ...
- openssl之aes加密(源码分析 AES_encrypt 与 AES_cbc_encrypt ,加密模式)
首先要了解AES加密是什么,以及几种加密模式的区别.之后才是编程.具体的编程案例,在下面的链接. openssl之aes加密(AES_cbc_encrypt 与 AES_encrypt 的编程案例) ...
- Tensorflow 运行警告提示 Your CPU supports instructions that this TensorFlow binary was not compiled to use
由于现在神经网络这个东西比较火,准确的说是深度学习这个东西比较火,我们实验室准备靠这个东西发几个CCF A类的文章,虽然我不太懂这东西,兴趣也一般都是毕竟要跟随主流的,于是今天安装起了 Tensorf ...