Kubernetes UI 儀表板不工作

Kubernetes UI 儀表板不工作

我正在嘗試對 Kubernetes UI 儀表板進行故障排除。到目前為止它還不起作用。我有一個包含三個節點的集群,1 個主節點和 2 個工作節點:

[admin@k8s-node1 ~]$ kubectl get nodes
NAME         STATUS   ROLES    AGE     VERSION
k8s-master   Ready    master   4d21h   v1.15.2
k8s-node1    Ready    <none>   4d20h   v1.15.2
k8s-node2    Ready    <none>   4d20h   v1.15.2

儀表板是使用最新版本安裝的。總而言之,這些服務似乎運作良好(kube-systemkubernetes-dashboard):

[admin@k8s-node1 ~]$ kubectl get pods --all-namespaces -o wide
NAMESPACE              NAME                                          READY   STATUS    RESTARTS   AGE     IP           NODE         NOMINATED NODE   READINESS GATES
kube-system            coredns-5c98db65d4-7fztc                      1/1     Running   2          4d20h   172.16.0.5   k8s-master   <none>           <none>
kube-system            coredns-5c98db65d4-wwb4t                      1/1     Running   2          4d20h   172.16.0.4   k8s-master   <none>           <none>
kube-system            etcd-k8s-master                               1/1     Running   1          4d20h   10.1.99.10   k8s-master   <none>           <none>
kube-system            kube-apiserver-k8s-master                     1/1     Running   1          4d20h   10.1.99.10   k8s-master   <none>           <none>
kube-system            kube-controller-manager-k8s-master            1/1     Running   1          4d20h   10.1.99.10   k8s-master   <none>           <none>
kube-system            kube-router-bt2rb                             1/1     Running   0          30m     10.1.99.11   k8s-node1    <none>           <none>
kube-system            kube-router-dnft9                             1/1     Running   0          30m     10.1.99.10   k8s-master   <none>           <none>
kube-system            kube-router-z98ns                             1/1     Running   0          29m     10.1.99.12   k8s-node2    <none>           <none>
kube-system            kube-scheduler-k8s-master                     1/1     Running   1          4d20h   10.1.99.10   k8s-master   <none>           <none>
kubernetes-dashboard   kubernetes-dashboard-5c8f9556c4-8skmv         1/1     Running   0          43m     172.16.1.4   k8s-node1    <none>           <none>
kubernetes-dashboard   kubernetes-metrics-scraper-86456cdd8f-htq9t   1/1     Running   0          43m     172.16.2.7   k8s-node2    <none>           <none>

問題是,啟動代理程式後,儀表板不會顯示在執行儀表板的工作電腦(節點 1)上:

網址:

http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/

錯誤訊息:

Error: 'dial tcp 172.16.1.4:8443: i/o timeout'
Trying to reach: 'https://172.16.1.4:8443/'

我傾向於路由,儘管路由器顯然都在運行。儀表板的日誌也顯示以下訊息:

Metric client health check failed: the server is currently unable to handle the request (get services dashboard-metrics-scraper). Retrying in 30 seconds.

任何幫助表示讚賞。我是 Kubernetes 新手,這是我的第一個叢集設置,所以我很抱歉。

答案1

我建議您檢查2 點,即1. 來自kubernetes-dashboard pod 的telnet 172.16.1.4:8443 & 2. 來自主節點的相同命令3. 如果可能,請嘗試安裝具有tcpdump 功能的sidecar pod 以找出封包傳輸

如果所有 3 個都顯示值 - 您可能需要附加到儀表板容器以驗證該容器列印的記錄。順便說一句,它在早些時候是否有效?

相關內容