现象

用浏览器打开 dashboard 页面时报错:

Service Unavailable

分析

在服务器使用 kubectl 命令查看 dashboard 状态正常

kubectl get pods -n kube-system

kube-system 是 dashboard 所在的命名空间;

查看日志:

kubectl logs kubernetes-dashboard-xxxx-xxx -n kube-system

及重启 pod,都会有一条报错:

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

解决

重启 kube-state-metrics

通过调整 scale 值来重启:

先设置副本数为 0:

kubectl scale deployment kube-state-metrics -n kube-system --replicas=0

再设置为 1:

kubectl scale deployment kube-state-metrics -n kube-system --replicas=1

重启后故障解除;

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐