错误一:
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清单文件中进行如下修改

  • --source=kubernetes:https://kubernetes.default?kubeletHttps=true&kubeletPort=10250&insecure=true
  • --sink=influxdb:http://monitoring-influxdb.kube-system.svc:8086

错误二:
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