我按照this指南在Fedora主节点上配置Kubernetes,一切顺利,但是当我使用UI时,我什么都没有,无法按照this指南中的说明进行安装,所以我创建了
{
"kind": "Namespace",
"apiVersion": "v1",
"metadata": {
"name": "kube-system"
}
}
并安装为
kubectl create -f https://rawgit.com/kubernetes/dashboard/master/src/deploy/kubernetes-dashboard.yaml --namespace=kube-system
安装得很好,但现在我去了
https://<my-ip>:8080/ui
我得到了
{
"paths": [
"/api",
"/api/v1",
"/apis",
"/apis/autoscaling",
"/apis/autoscaling/v1",
"/apis/batch",
"/apis/batch/v1",
"/apis/extensions",
"/apis/extensions/v1beta1",
"/healthz",
"/healthz/ping",
"/logs/",
"/metrics",
"/resetMetrics",
"/swaggerapi/",
"/version"
]
}
并尝试使用
http://<my-ip>:8080/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard
用于访问并获取
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {},
"status": "Failure",
"message": "no endpoints available for service \"kubernetes-dashboard\"",
"reason": "ServiceUnavailable",
"code": 503
}
并且不知道如何修复它。有什么建议?
更新1 确认已安装插件
root@fed-master ~]# kubectl get deployment kubernetes-dashboard --namespace=kube-system
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
kubernetes-dashboard 1 0 0 0 2h
[root@fed-master ~]# kubectl get svc kubernetes-dashboard --namespace=kube-system
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes-dashboard 10.254.154.193 nodes 80/TCP 2h
更新2
kubectl --namespace=kube-system get ep kubernetes-dashboard
给出
NAME ENDPOINTS AGE
kubernetes-dashboard <none> 4h
现在问题是,如何自己设置端点?
答案 0 :(得分:0)
我在Kubernetes中非常新,但我只是让我在本地VM群集中使用仪表板,所以我将分享我最近的经验,以防它有用。< / p>
我使用
安装了它,就像你一样kubectl create -f https://rawgit.com/kubernetes/dashboard/master/src/deploy/kubernetes-dashboard.yaml
给了我这个输出:
deployment "kubernetes-dashboard" created
You have exposed your service on an external port on all nodes in your
cluster. If you want to expose this service to the external internet, you may
need to set up firewall rules for the service port(s) (tcp:32548) to serve traffic.
See http://releases.k8s.io/release-1.2/docs/user-guide/services-firewalls.md for more details.
service "kubernetes-dashboard" created
所以我使用master的IP地址和输出中声明的端口通过浏览器访问它,如:
http://<kube-master-IP>:<port>
就我而言,它是:
http://172.17.4.101:32548
但是我在我的机器上做了,所以,正如上面的输出所述,请注意:
如果您想将此服务公开给外部互联网,您可以 需要为服务端口(tcp:32548)设置防火墙规则 服务交通。
答案 1 :(得分:0)
同样的事发生在我身上。有趣的是,它实际上是在4194端口运行。我做了netstat -planet | grep LISTEN并尝试了所有端口监听。当我到达4194时,我拿到了仪表板。一切都在运作。您只需正确配置它以路由到您想要的端口。