What CRDs does the Prometheus Operator provide?
IntermediateConceptKubernetes Monitoring, Scale & Cloud
Answer
| CRD | Purpose |
|---|---|
Prometheus / PrometheusAgent |
A Prometheus (or agent) deployment and its config |
Alertmanager |
An Alertmanager cluster |
ServiceMonitor |
Scrape endpoints behind a Kubernetes Service |
PodMonitor |
Scrape pods directly, no Service needed |
Probe |
Blackbox-style probing of static targets or Ingresses |
ScrapeConfig |
Raw scrape configs (static, file, HTTP, EC2 SD and more) |
PrometheusRule |
Recording and alerting rules |
AlertmanagerConfig |
Namespaced routes, receivers and inhibitions |
ThanosRuler |
Thanos rule evaluation |
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata: { name: api, labels: { release: monitoring } }
spec:
selector: { matchLabels: { app: api } }
endpoints: [{ port: http-metrics, interval: 30s }]
App teams own their ServiceMonitors and PrometheusRules in their namespace; the platform team owns the Prometheus object.
More on Kubernetes Monitoring, Scale & Cloud
What is kube-prometheus-stack and what does it install?BeginnerHow does the Prometheus Operator decide which ServiceMonitors to load?IntermediateWhich cAdvisor container memory metric should you watch, and why?IntermediateHow do metrics-server and the custom/external metrics APIs relate to HPA?IntermediateWhich kube-state-metrics metrics do you use most?BeginnerWhat endpoints does the kubelet expose for Prometheus?Advanced