认识
我们需要通过 Prometheus Operator 来管理 Prometheus 部署,起因是 Rook Ceph 提供基于 Prometheus Operator 的监控方案(PrometheusRule),要想使用 Rook Ceph 自带的监控方案,我们就需要部署 Prometheus Operator 服务;
Prometheus Operator 是一个 Kubernetes Operator,由 CoreOS 创建,用于简化 Prometheus 在 Kubernetes 环境中的部署、配置和管理。
组成
概念 | 术语 | Terms | Fundamentals
资源类型(Resource Types)
prometheus-operator/Documentation/api.md at
Alertmanager
PodMonitor
Probe
Prometheus
PrometheusRule
ServiceMonitor
ThanosRuler
性质
The Prometheus Operator uses Kubernetes custom resources to simplify the deployment and configuration of Prometheus, Alertmanager, and related monitoring components.
Prometheus Operator 提供了一种方法,允许你定义和管理 Prometheus 和 Alertmanager 实例以及相关的配置。它为这些组件提供了自定义资源定义 (Custom Resource Definitions, CRDs),如 `Prometheus`,`ServiceMonitor` 和 `Alertmanager`,这样你就可以在 Kubernetes 中以声明性的方式定义和管理监控目标。
例如,使用 `ServiceMonitor`,你可以指定某个服务的监控配置,然后 Prometheus Operator 会自动配置 Prometheus 来抓取这个服务的指标。这样可以更容易地在 Kubernetes 集群中添加和删除监控目标。
应用
但是,该仓库的 Helm Chart 已移动到 prometheus-community/kube-prometheus-stack 仓库,不再提供单独的 Helm Chart 包来单独安装 Prometheus Operator 服务;
源码仓库:https://github.com/prometheus-operator/prometheus-operator/tree/main
官方文档:
Prometheus Operator 提供了一种高效的方式来在 Kubernetes 集群中部署和管理 Prometheus 监控系统。
改进
WIP
参考
Prometheus Operator creates/configures/manages Prometheus clusters atop Kubernetes
Prometheus Operator – Running Prometheus on Kubernetes