heapster部署遇到错误

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了heapster部署遇到错误相关的知识,希望对你有一定的参考价值。

错误一:
Error in scraping containers from kubelet_summary:192.168.xx.xxx:10255: Get http://192.168.xx.xxx:10255/stats/summary/: dial tcp 192.168.xx.xxx:10255: getsockopt: connection refused
W0425 09:14:25.000355 1 manager.go:152] Failed to get all responses in time (got 0/1)

#在heapster.yaml清单文件中进行如下修改

错误二:
W0703 10:28:25.000491 1 manager.go:152] Failed to get all responses in time (got 0/1)
I0703 10:28:25.013285 1 influxdb.go:274] Created database "k8s" on influxDB server at "monitoring-influxdb.kube-system.svc:8086"
E0703 10:29:05.005431 1 manager.go:101] Error in scraping containers from kubelet:192.168.xx.xxx:10250: failed to get all container stats from Kubelet URL "https://192.168.xx.xxx:10250/stats/container/": request failed - "403 Forbidden", response: "Forbidden (user=system:serviceaccount:kube-system:heapster, verb=create, resource=nodes, subresource=stats)

解决方法:
查看ClusterRole: system:heapster的权限,发现的确没有针对Resource: nodes/stats 的create权限
#kubectl describe clusterrole system:heapster
生成清单文件
#kubectl get clusterrole system:heapster -o yaml > heapster_modify.yaml
#kubectl delete -f heapster_modify.yaml
#kubectl apply -f heapster_modify.yaml
#kubectl delete -f heapster.yaml
#kubectl apply -f heapster.yaml

以上是关于heapster部署遇到错误的主要内容,如果未能解决你的问题,请参考以下文章

09-3.部署 heapster 插件

k8s监控组件heapster安装部署

基于 Kubernetes v1.14.0 之heapster与influxdb部署

K8S插件 heapster

使用Heapster和Splunk监控Kubernetes运行性能

13安装heapster