感谢您 的文档,目前服务都启动成功了,但是不能通过页面去访问:
Master/Node IPs:
...
master: 10.192.29.207
node: 10.192.29.208
...
Services status:
[root@localhost heapster]# /root/local/bin/kubectl get services --all-namespaces -s 10.192.29.207:8080
NAMESPACE NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
default kubernetes 10.254.0.1 <none> 443/TCP 5h
kube-system heapster 10.254.56.15 <none> 80/TCP 21m
kube-system kube-dns 10.254.0.2 <none> 53/UDP,53/TCP 3h
kube-system kubernetes-dashboard 10.254.172.131 <nodes> 80:8791/TCP 1h
kube-system monitoring-grafana 10.254.80.55 <none> 80/TCP 21m
kube-system monitoring-influxdb 10.254.223.124 <nodes> 8086:8686/TCP,8083:8614/TCP 21m
Pods Status
[root@localhost heapster]# /root/local/bin/kubectl get pods --all-namespaces -s 10.192.29.207:8080
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system heapster-334572188-63gqs 1/1 Running 1 27m
kube-system kube-dns-2298276164-frjpg 3/3 Running 6 3h
kube-system kubernetes-dashboard-3377982832-r5906 1/1 Running 1 1h
kube-system monitoring-grafana-854043867-6zddh 1/1 Running 1 27m
kube-system monitoring-influxdb-340252977-n944m 1/1 Running 1 27m
Cluster info
[root@localhost heapster]# /root/local/bin/kubectl cluster-info -s 10.192.29.207:8080
Kubernetes master is running at 10.192.29.207:8080
Heapster is running at 10.192.29.207:8080/api/v1/proxy/namespaces/kube-system/services/heapster
KubeDNS is running at 10.192.29.207:8080/api/v1/proxy/namespaces/kube-system/services/kube-dns
kubernetes-dashboard is running at 10.192.29.207:8080/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard
monitoring-grafana is running at 10.192.29.207:8080/api/v1/proxy/namespaces/kube-system/services/monitoring-grafana
monitoring-influxdb is running at 10.192.29.207:8080/api/v1/proxy/namespaces/kube-system/services/monitoring-influxdb
Browser - http://10.192.29.207:8080
{
"paths": [
"/api",
"/api/v1",
"/apis",
"/apis/apps",
"/apis/apps/v1beta1",
"/apis/authentication.k8s.io",
"/apis/authentication.k8s.io/v1",
"/apis/authentication.k8s.io/v1beta1",
"/apis/authorization.k8s.io",
"/apis/authorization.k8s.io/v1",
"/apis/authorization.k8s.io/v1beta1",
"/apis/autoscaling",
"/apis/autoscaling/v1",
"/apis/autoscaling/v2alpha1",
"/apis/batch",
"/apis/batch/v1",
"/apis/batch/v2alpha1",
"/apis/certificates.k8s.io",
"/apis/certificates.k8s.io/v1beta1",
"/apis/extensions",
"/apis/extensions/v1beta1",
"/apis/policy",
"/apis/policy/v1beta1",
"/apis/rbac.authorization.k8s.io",
"/apis/rbac.authorization.k8s.io/v1alpha1",
"/apis/rbac.authorization.k8s.io/v1beta1",
"/apis/settings.k8s.io",
"/apis/settings.k8s.io/v1alpha1",
"/apis/storage.k8s.io",
"/apis/storage.k8s.io/v1",
"/apis/storage.k8s.io/v1beta1",
"/healthz",
"/healthz/ping",
"/healthz/poststarthook/bootstrap-controller",
"/healthz/poststarthook/ca-registration",
"/healthz/poststarthook/extensions/third-party-resources",
"/healthz/poststarthook/rbac/bootstrap-roles",
"/logs",
"/metrics",
"/swagger-ui/",
"/swaggerapi/",
"/ui/",
"/version"
]
}
flannel的配置,PS 在master和node上都配置了flannel
[root@localhost ~]# /root/local/bin/etcdctl --endpoints=${ETCD_ENDPOINTS} --ca-file=/etc/kubernetes/ssl/ca.pem --cert-file=/etc/kubernetes/ssl/kubernetes.pem --key-file=/etc/kubernetes/ssl/kubernetes-key.pem ls ${FLANNEL_ETCD_PREFIX}/subnets
2017-04-24 17:28:20.417878 I | warning: ignoring ServerName for user-provided CA for backwards compatibility is deprecated
/kubernetes/network/subnets/172.30.66.0-24
/kubernetes/network/subnets/172.30.38.0-24
[root@localhost ~]# /root/local/bin/etcdctl --endpoints=${ETCD_ENDPOINTS} --ca-file=/etc/kubernetes/ssl/ca.pem --cert-file=/etc/kubernetes/ssl/kubernetes.pem --key-file=/etc/kubernetes/ssl/kubernetes-key.pem get ${FLANNEL_ETCD_PREFIX}/subnets/172.30.38.0-24
2017-04-24 17:28:28.398278 I | warning: ignoring ServerName for user-provided CA for backwards compatibility is deprecated
{"PublicIP":"10.192.29.208","BackendType":"vxlan","BackendData":{"VtepMAC":"6a:06:02:bb:c2:21"}}
但是通过 浏览器都不能访问UI, 比如dashboard UI: http://10.192.29.207:8080/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy/
Error: 'dial tcp 172.30.38.2:9090: getsockopt: connection timed out'
Trying to reach: 'http://172.30.38.2:9090/'
由于dashboard 还暴露了NodePort
kube-system kubernetes-dashboard 10.254.172.131 <nodes> 80:8791/TCP 1h
所以我通过浏览器访问http://10.192.29.208:8791, 也是报同样的错误
ERROR
The requested URL could not be retrieved
The following error was encountered while trying to retrieve the URL: http://10.192.29.208:8791/
Connection to 10.192.29.208 failed.
The system returned: (110) Connection timed out
The remote host or network may be down. Please try the request again.
Your cache administrator is webmaster.
然后我在Node中curl http://10.192.29.208:8791, 是有返回正常页面内容的(虽然是浏览器不兼容的信息)
[root@localhost ~]# curl 10.192.29.208:8791
<!doctype html> <html ng-app="kubernetesDashboard"> <head> <meta charset="utf-8"> <title ng-controller="kdTitle as $ctrl" ng-bind="$ctrl.title()"></title> <link rel="icon" type="image/png" href="assets/images/kubernetes-logo.png"> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="static/vendor.4f4b705f.css"> <link rel="stylesheet" href="static/app.93b90a74.css"> </head> <body> <!--[if lt IE 10]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser.
Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your
experience.</p>
<![endif]--> <kd-chrome layout="column" layout-fill> </kd-chrome> <script src="static/vendor.6952e31e.js"></script> <script src="api/appConfig.json"></script> <script src="static/app.8a6b8127.js"></script> </body> </html> [root@localhost ~]#
想请教下,怎么通过master访问页面? thx.
另外firewalld是关闭的,selinux也是disabled
另外我node上ip address如下:
[root@localhost ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:b8:f2:de brd ff:ff:ff:ff:ff:ff
inet 10.192.29.208/24 brd 10.192.29.255 scope global ens160
valid_lft forever preferred_lft forever
inet6 fe80::2a26:38cb:ad83:7903/64 scope link
valid_lft forever preferred_lft forever
3: flannel.1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN
link/ether 6a:06:02:bb:c2:21 brd ff:ff:ff:ff:ff:ff
inet 172.30.38.0/32 scope global flannel.1
valid_lft forever preferred_lft forever
4: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP
link/ether 02:42:f5:95:3e:dd brd ff:ff:ff:ff:ff:ff
inet 172.30.38.1/24 scope global docker0
valid_lft forever preferred_lft forever
inet6 fe80::42:f5ff:fe95:3edd/64 scope link
valid_lft forever preferred_lft forever
这个问题已经困扰我好几天了,不知道怎么下手了,全部重新配置以后依然是这个问题。有没有debug的建议? thx