Skip to main content
Prometheus is the de facto monitoring engine for collecting metrics and evaluating alerting rules in cloud-native environments. Running Prometheus effectively on Kubernetes requires more than a single container: you must provision the server, choose durable storage, wire up scrape targets, load recording and alerting rules, and keep configuration synchronized with cluster resources.
The image describes Prometheus as a monitoring engine, highlighting tasks like creating the server, choosing storage, wiring scrape targets, loading alerting rules, and keeping configuration in sync.
The Prometheus Operator automates these operational tasks using Kubernetes-native, declarative resources and a controller that continuously reconciles the desired state into a running Prometheus instance.
The image depicts a flowchart titled "A Monitoring Assembly Line," illustrating how application and platform teams contribute to creating a final Prometheus configuration through an operator.
Conceptually, think of the operator as a monitoring assembly line:
  • Application teams express what should be monitored (monitoring intent).
  • Platform teams define Prometheus instances that will do the scraping and alerting.
  • The operator composes those inputs into a final Prometheus runtime configuration (prometheus.yml, StatefulSets, Services, ConfigMaps, Secrets) and keeps them in sync.
Instead of manually editing a central prometheus.yml, you work with custom resources (CRDs) such as Prometheus, ServiceMonitor, PodMonitor, and PrometheusRule. Each custom resource declares desired behavior and ownership; the controller implements that desired state by creating and updating the underlying Kubernetes objects.
The image describes how custom resources, such as Prometheus, ServiceMonitor, PodMonitor, and PrometheusRule, can replace manual edits of prometheus.yml for tasks like scraping and alerting.

Key custom resources (CRDs)

Example: ServiceMonitor

A ServiceMonitor lets application teams publish monitoring intent as Kubernetes objects. The operator discovers matching ServiceMonitors and includes them in the generated Prometheus configuration.

Example: Prometheus resource with selectors

Platform teams use the Prometheus CR to define a Prometheus instance and scope which monitoring objects it ingests. Use label selectors to enforce clear ownership boundaries across teams.
A ServiceMonitor owned by the payments team would include the corresponding label:
This label-selector pattern enables platform and application teams to collaborate without giving direct write access to a shared Prometheus config file. The operator composes those independent resources into a coherent Prometheus runtime configuration.

How selectors and ownership work

A Prometheus resource uses selectors to determine which ServiceMonitors, PodMonitors, and PrometheusRules belong to it. This model supports multi-tenant or shared clusters by scoping ingestion to labeled resources:
  • Platform teams create one or more Prometheus instances and configure selectors.
  • Application teams label their ServiceMonitors/PodMonitors/PrometheusRules to indicate ownership.
  • The operator discovers matching objects and includes them in the generated Prometheus configuration.
Use consistent label conventions (for example, team: payments) to make ownership and intent explicit across your organization.

Operator responsibilities and reconciliation

The Prometheus Operator handles lifecycle details that are error-prone when done manually:
  • When selected ServiceMonitors or PrometheusRules change, the operator regenerates the Prometheus configuration and triggers a reload.
  • When the Prometheus custom resource changes, the operator updates the managed StatefulSet and related resources so the running server matches the desired state.
  • The controller continuously reconciles discrepancies (drift) instead of relying on manual reloads or human memory.
The image illustrates a process where changes in monitors, rules, and Prometheus resources lead to generated config updates and StatefulSet adjustments, highlighting reconciliation handling drift.

Deployment patterns and ecosystem

In production clusters, the Prometheus Operator is frequently installed as part of a broader monitoring stack (for example, using Helm charts) that includes:
  • Prometheus servers
  • Alertmanager
  • Grafana
  • Prometheus exporters
  • Dashboards and default alerting rules
After installation, cluster resources (ServiceMonitors, PodMonitors, PrometheusRules) are the primary extension points teams use to customize monitoring behavior for their applications.
Selectors in the Prometheus resource control which monitoring objects a Prometheus instance will ingest. Use labels and selectors to enforce clear ownership boundaries in shared clusters.
You will deploy Prometheus through the operator, create a monitored target, and use a ServiceMonitor to connect it to the Prometheus instance.

Watch Video