ScriptsApr 16, 2026·3 min read

Prometheus Operator — Kubernetes-Native Monitoring Stack Management

Prometheus Operator simplifies deploying and managing Prometheus, Alertmanager, and related monitoring components on Kubernetes using custom resources and reconciliation loops.

TL;DR
Prometheus Operator manages Prometheus and Alertmanager on Kubernetes via custom resources.
§01

What it is

Prometheus Operator is a Kubernetes operator that automates the deployment and management of Prometheus, Alertmanager, and related monitoring components. Instead of writing raw Kubernetes manifests for monitoring infrastructure, you define custom resources like Prometheus, ServiceMonitor, and AlertmanagerConfig. The operator watches these resources and reconciles the actual state to match your declarations.

Prometheus Operator targets SREs, DevOps engineers, and platform teams who run Kubernetes and need a production-grade monitoring stack that scales with their cluster without manual configuration management.

§02

How it saves time or tokens

Without the operator, deploying Prometheus on Kubernetes requires managing StatefulSets, ConfigMaps with scrape configs, RBAC rules, and persistent volumes manually. The operator handles all of this through custom resources. Adding a new scrape target is as simple as creating a ServiceMonitor resource; the operator automatically updates the Prometheus configuration.

For teams managing multiple clusters, the operator provides a consistent, declarative approach to monitoring that can be versioned and replicated through GitOps workflows.

§03

How to use

  1. Install the Prometheus Operator using Helm: helm install prometheus prometheus-community/kube-prometheus-stack. This deploys Prometheus, Alertmanager, Grafana, and the operator.
  2. Create a ServiceMonitor custom resource to scrape metrics from your application. The operator detects the resource and configures Prometheus automatically.
  3. Define alerting rules with PrometheusRule resources. The operator loads them into Prometheus without manual config reloads.
§04

Example

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: my-app-monitor
  labels:
    release: prometheus
spec:
  selector:
    matchLabels:
      app: my-app
  endpoints:
    - port: metrics
      interval: 30s
      path: /metrics

This ServiceMonitor tells Prometheus to scrape the /metrics endpoint of any service labeled app: my-app every 30 seconds. No manual Prometheus config editing required.

§05

Related on TokRepo

§06

Common pitfalls

  • ServiceMonitor labels must match the Prometheus resource's serviceMonitorSelector. If your monitors are not being picked up, check the label matching between Prometheus and ServiceMonitor resources.
  • The kube-prometheus-stack Helm chart deploys many components by default (Grafana, node-exporter, kube-state-metrics). Disable components you do not need to reduce resource usage.
  • Prometheus stores metrics locally by default. For long-term retention, configure a remote write destination like Thanos, Cortex, or Mimir.

Frequently Asked Questions

What is the difference between Prometheus and Prometheus Operator?+

Prometheus is the monitoring system that scrapes and stores metrics. Prometheus Operator is a Kubernetes operator that automates deploying and configuring Prometheus using custom resources. The operator manages the lifecycle of Prometheus instances on Kubernetes.

Does the operator support high availability?+

Yes. You can configure multiple Prometheus replicas through the Prometheus custom resource. The operator handles replica management, and tools like Thanos can deduplicate data across replicas for HA queries.

Can I use Prometheus Operator without Helm?+

Yes. You can deploy the operator using raw Kubernetes manifests or kustomize. The Helm chart (kube-prometheus-stack) is the most common installation method because it bundles everything, but it is not required.

How do I add alerting rules?+

Create a PrometheusRule custom resource with your alerting rules in the standard Prometheus alerting format. The operator detects the resource and loads the rules into Prometheus. No restart or config reload is needed.

Does Prometheus Operator work with managed Kubernetes?+

Yes. It works on EKS, GKE, AKS, and any conformant Kubernetes cluster. The operator uses standard Kubernetes APIs and does not depend on cloud-provider-specific features.

Citations (3)

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets