Cluster Monitoring Operator
The Cluster Monitoring Operator manages and updates the Prometheus-based cluster monitoring stack deployed on top of OpenShift.
It contains the following components:
- Prometheus Operator
- Alertmanager cluster for cluster and application level alerting
The deployed Prometheus Operator is intended to be used only for cluster-level monitoring.
As such, the deployed Prometheus instance (
prometheus-k8s) is responsible for monitoring and alerting on cluster and OpenShift components; it should not be extended to monitor user applications.
Important: The Prometheus Operator managed by the Cluster Monitoring Operator will by default only look for
ServiceMonitor resources in
Users interested in leveraging Prometheus for application monitoring on OpenShift should consider using OLM to easily deploy a Prometheus Operator and setup new Prometheus instances to monitor and alert on their applications.
Alertmanager is a cluster-global component for handling alerts generated by all Prometheus instances deployed in that cluster.
Metrics are collected from the following components:
- API server
- Prometheus (just
Contributing new component integrations
The Cluster Monitoring Operator has many builtin
ServiceMonitor resources which enable discovering the metrics endpoints of a variety of well-known components. Only components that must be created before the cluster monitoring stack belong in this repository, in order to solve the cyclic dependencies of bootstrapping.
To register a new builtin component, make the following changes:
- Add a new
ServiceMonitormanifest file to jsonnet/prometheus.jsonnet. An example of this can be seen for the OpenShift component "kube-controllers", here.
- Re-generate the go-bindata code, using the
pkg/manifests/bindata.gomake target. This will also create a new file in
assets/prometheus-k8s/according to the name given in the jsonnet code.
- Add a constant in pkg/manifests/manifests.go which points to the new manifest file, from
- Add a new
Factorymethod in pkg/manifests/manifests.go which loads the manifest using the new constant.
- Add a step to
PrometheusTaskin pkg/tasks/prometheus.go which creates the
To add new builtin recording or alerting rules:
make pkg/manifests/bindata.go after you modify the files and make sure to add the modified files to the commit. All rules are automatically created, so no additional code changes are necessary.
- Monitor etcd
- Adapt Tectonic inherited alerts with OpenShift operational knowledge
Run e2e-tests with
Clean up after e2e-tests with