【发布时间】:2023-12-22 07:19:01
【问题描述】:
我正在使用prometheus-operator 管理我的Kubernetes 集群上的Prometheus 部署。该设置可以很好地从我的许多应用程序 pod 中提取指标,使用几个 ServiceMonitor 选择 Kubernetes 端点,提供发布指标的网络地址。 prometheus-operator 似乎很典型(必需?),Prometheus 配置是根据基于 ServiceMonitors 发现的 Kubernetes 端点为我生成的。
我还希望我的 Prometheus 部署能够在每个集群节点上检索 the cAdvisor metrics published by kubelet。我已经验证了集群上的 kubelet 具有 cAdvisor 并且已启用(通过访问端口 4194 并观察本机 cAdvisor Web 界面)。但是,我缺少的是如何告诉 prometheus-operator 配置我的 Prometheus 部署,目标包括每个 kubelet/cAdvisor 服务器。
我在这方面找到的唯一“文档”是 a prometheus-operator github issue,询问为什么在发布者的集群中发现了一些 cAdvisor 指标。解释表明 kubelet/cAdvisor 的 Kubernetes 端点是由 prometheus-operator 以某种方式创建的,然后额外的 ServiceMonitor 找到它们并导致 Prometheus 配置有额外的目标。但是,这些 Kubernetes 端点在我的 Kubernetes 集群上不存在,我也没有找到任何关于它们为什么会存在的信息。
我需要进行哪些配置才能让我的 prometheus-operator-configured Prometheus 部署能够获得这些指标?
【问题讨论】:
标签: kubernetes metrics prometheus prometheus-operator