Kubernetes Web UI(仪表板)不显示图表

Kubernetes Web UI (Dashboard) doesn't show graphs

我已经在 2 个 minion 节点和一个主节点上安装了 Docker v17.06-ce 和带有 Kubeadm v1.7.0 的 Kubernetes。然后我使用 kubectl create -f https://git.io/kube-dashboard 部署了 Web UI(仪表板),并使用 kubectl edit service kubernetes-dashboard -n kube-system.

将类型更改为 NodePort

我可以访问它,但缺少 CPU/Memory 使用图表。所以我已经按照 的说明部署了 heapster 和 influxdb,但我仍然看不到图表...

怎么了?

更新: 检查日志 kubectl logs heapster-2994581613-m28hh --namespace=kube-system 我反复发现这些错误:

E0717 09:14:05.000881       7 kubelet.go:271] No nodes received from APIserver.
E0717 09:14:05.947260       7 reflector.go:203] k8s.io/heapster/metrics/processors/node_autoscaling_enricher.go:100: Failed to list *api.Node: the server does not allow access to the requested resource (get nodes)
E0717 09:14:05.959150       7 reflector.go:203] k8s.io/heapster/metrics/heapster.go:319: Failed to list *api.Pod: the server does not allow access to the requested resource (get pods)
E0717 09:14:05.959254       7 reflector.go:203] k8s.io/heapster/metrics/heapster.go:327: Failed to list *api.Node: the server does not allow access to the requested resource (get nodes)
E0717 09:14:05.959888       7 reflector.go:203] k8s.io/heapster/metrics/sources/kubelet/kubelet.go:342: Failed to list *api.Node: the server does not allow access to the requested resource (get nodes)
E0717 09:14:05.959995       7 reflector.go:203] k8s.io/heapster/metrics/processors/namespace_based_enricher.go:84: Failed to list *api.Namespace: the server does not allow access to the requested resource (get namespaces)
E0717 09:14:06.957399       7 reflector.go:203] k8s.io/heapster/metrics/processors/node_autoscaling_enricher.go:100: Failed to list *api.Node: the server does not allow access to the requested resource (get nodes)
E0717 09:14:06.965155       7 reflector.go:203] k8s.io/heapster/metrics/sources/kubelet/kubelet.go:342: Failed to list *api.Node: the server does not allow access to the requested resource (get nodes)
E0717 09:14:06.965166       7 reflector.go:203] k8s.io/heapster/metrics/heapster.go:327: Failed to list *api.Node: the server does not allow access to the requested resource (get nodes)
E0717 09:14:06.966403       7 reflector.go:203] k8s.io/heapster/metrics/heapster.go:319: Failed to list *api.Pod: the server does not allow access to the requested resource (get pods)
E0717 09:14:06.966964       7 reflector.go:203] k8s.io/heapster/metrics/processors/namespace_based_enricher.go:84: Failed to list *api.Namespace: the server does not allow access to the requested resource (get namespaces)

有什么想法吗?

您需要安装 heapster pod。尝试安装并检查。

同时安装 heapster rbac。

kubectl  create -f https://raw.githubusercontent.com/kubernetes/heapster/master/deploy/kube-config/rbac/heapster-rbac.yaml

kubectl create -f https://raw.githubusercontent.com/kubernetes/heapster/master/deploy/kube-config/influxdb/heapster.yaml