Prometheus配置

通常不需要直接编辑 Prometheus 自定义资源,因为监控应用程序会根据 ServiceMonitors 和 PodMonitors 的变化自动更新它。

本节假设您对监控组件如何协同工作有一定了解。有关更多信息,请参见 本节。

关于 Prometheus 自定义资源

Prometheus CR 定义了期望的 Prometheus 部署。Prometheus Operator 观察 Prometheus CR。当 CR 发生变化时,Prometheus Operator 会根据 CR 配置创建 prometheus-rancher-monitoring-prometheus,即 Prometheus 部署。

Prometheus CR 指定了规则等详细信息,以及连接到 Prometheus 的 Alertmanagers。Rancher 为您构建此 CR。

监控 V2 每个集群仅支持一个 Prometheus。但是,如果您想将监控限制在某些名称空间,您可能需要编辑 Prometheus CR。