【发布时间】:2019-02-18 14:13:58
【问题描述】:
我将 Prometheus 和 Grafana 部署到我的集群中。
当我打开仪表板时,我没有获得 pod CPU 使用率的数据。
当我检查 Prometheus UI 时,它显示 pods 0/0 up,但是我的集群中有许多 pods 运行。
可能是什么原因?我有节点导出器在所有节点中运行。
我正在为 kube-state-metrics 获取这个,
I0218 14:52:42.595711 1 builder.go:112] Active collectors: configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,jobs,limitranges,namespaces,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets
I0218 14:52:42.595735 1 main.go:208] Starting metrics server: 0.0.0.0:8080
这是我的 Prometheus 配置文件: https://gist.github.com/karthikeayan/41ab3dc4ed0c344bbab89ebcb1d33d16
我可以点击并获取以下数据:
http://localhost:8080/api/v1/nodes/<my_worker_node>/proxy/metrics/cadvisor
【问题讨论】:
-
不是每个人都有时间通过研讨会来了解您遵循了哪些步骤。那么您能否在您的问题中添加更多信息,特别是 - 1)您对 Pod 使用了什么配置,以及 2)Prometheus 用户界面上的 Prometheus 配置 YAML 是什么样的?
-
不确定 prometheus 配置中的哪个部分会有所帮助,上传完整文件.. 还添加了更多细节..
-
您有 cAdvisor 目标吗?它有目标吗?
-
是的,我可以看到其中一个工作名称是 kudernetes-nodes-cadvisor
-
好的,我在 values.yaml cmets 中发现了一些有趣的东西,
prometheus.io/scrape:只刮取值为true的 pod,当我在 k8s configmap 中删除这个 relabel_config 时,我得到了数据在 prometheus ui 中.. 不幸的是 k8s configmap 没有 cmets,我相信 helm 会在部署之前删除 cmets..
标签: kubernetes monitoring prometheus grafana