5. Get http://localhost:8080/version: dial tcp 202.102.110.203:8080: getsockopt: connection refused
1
2
3
4
# docker logs b7cff1accc06
Starting HTTP server on port 9090
Creating API server client for http://localhost: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://localhost:8080/version: dial tcp 202.102.110.203:8080: getsockopt: connection refused
删除原有失败的kubernetes-dashboard
1
# kubectl delete -f slug:-dashboard.yaml
修改 slug:-dashboard.yaml 文件加入以下行
1
2
3
4
5
6
7
8
9
10
# vim slug:-dashboard.yaml
ports:
- containerPort: 9090
protocol: TCP
args:
# Uncomment the following line to manually specify Kubernetes API server Host
# If not specified, Dashboard will attempt to auto discover the API server and connect
# to it. Uncomment only if the default does not work.
# - --apiserver-host=http://my-address:port
- --apiserver-host=http://192.168.2.247:8080 ##加入此行 指定apiserver地址
重新创建kubernetes-dashboard
1
# kubectl create -f slug:-dashboard.yaml
6. 不能浏览器访问kubernetes-dashboard
1
2
Error: 'dial tcp 172.17.97.3:9090: i/o timeout'
Trying to reach: 'http://172.17.97.3:9090/'
master上安装flannel
1
# yum install -y flannel
编辑flannel配置文件并启动
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# vim /etc/sysconfig/flanneld
# Flanneld configuration options
# etcd url location. Point this to the server where etcd runs
FLANNEL_ETCD="http://192.168.2.247:2379"
# etcd config key. This is the configuration key that flannel queries
# For address range assignment
FLANNEL_ETCD_KEY="/coreos.com/network"
# Any additional options that you want to pass
#FLANNEL_OPTIONS=""
# systemctl enable flanneld.service ; systemctl start flanneld.service