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>

问题是,当激活代理时,仪表板不会显示在运行仪表板的工作机器(node1)上:

网址:

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 个都显示值 - 您可能需要连接到仪表板 pod 以验证该 pod 打印的日志。顺便问一下,它之前任何时候都有效吗?

相关内容