我正在使用以下命令部署 kubernetes UI:
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
Run Code Online (Sandbox Code Playgroud)
启动代理:
kubectl proxy --address='172.19.104.231' --port=8001 --accept-hosts='^*$'
Run Code Online (Sandbox Code Playgroud)
访问用户界面:
curl http://172.19.104.231:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
http://kubernetes.example.com/api/v1/namespaces/kube-system/services/kube-ui/#/dashboard/
Run Code Online (Sandbox Code Playgroud)
日志输出:
[root@iZuf63refzweg1d9dh94t8Z ~]# curl http://172.19.104.231:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {
},
"status": "Failure",
"message": "services \"kubernetes-dashboard\" not found",
"reason": "NotFound",
"details": {
"name": "kubernetes-dashboard",
"kind": "services"
},
"code": 404}
Run Code Online (Sandbox Code Playgroud)
如何解决问题?检查 Pod 状态:
[root@iZuf63refzweg1d9dh94t8Z ~]# kubectl get pod --namespace=kube-system
NAME READY STATUS RESTARTS AGE
kubernetes-dashboard-7d75c474bb-b2lwd 0/1 Pending 0 34h
Run Code Online (Sandbox Code Playgroud)
小智 20
如果您使用 K8S 仪表板 v2.0.0-betax,
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0-beta8/aio/deploy/recommended.yaml
Run Code Online (Sandbox Code Playgroud)
然后使用它来访问仪表板:
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
Run Code Online (Sandbox Code Playgroud)
如果您使用 K8S 仪表板 v1.10.1,
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.10.1/src/deploy/recommended/kubernetes-dashboard.yaml
Run Code Online (Sandbox Code Playgroud)
然后使用它来访问仪表板:
http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
Run Code Online (Sandbox Code Playgroud)
我也遇到了同样的问题,但后来我意识到仪表板 v2.0.0-betax 和 v1.10.1 使用不同的命名空间。最新版本使用 kubernetes-dashboard 命名空间,但旧版本使用 kube-system 命名空间
| 归档时间: |
|
| 查看次数: |
16681 次 |
| 最近记录: |