Prometheus Operator
Monitoring & ObservabilityKubernetes-native deployment and management of Prometheus
Part of Prometheus
Release history
v0.94.0
CompareGitHub
- [CHANGE] Update the default Alertmanager version to v0.34.0 and discard zero-value duration fields (
retention,clusterGossipInterval,clusterPushpullInterval,clusterPeerTimeout) inAlertmanagerresources instead of passing them as CLI flags, which Alertmanager rejects and can cause startup failures. Ignored fields are reported via theIgnoredFieldsstatus condition. #8800 - [CHANGE] Add named enum types for Hetzner, Docker Swarm, and OpenStack service discovery fields in the
ScrapeConfigCRD (HetznerRole,DockerSwarmRole,OpenStackAvailability). #8789 - [CHANGE] Reject empty strings in
namespaceDiscovery.names,consulSDConfig.services, andconsulSDConfig.tagslist fields in theScrapeConfigCRD. #8786 - [FEATURE] Add
retentionPercentagefield toPrometheusandPrometheusAgentCRDs for volume-based retention (requires Prometheus >= v3.11.0). Setting only the percentage no longer falls back to the default 24h time-based retention. #8728 - [FEATURE] Add
clusterPeerNamefield toAlertmanagerCRD to override the--cluster.peer-nameflag (requires Alertmanager >= v0.30.0). #8767 - [FEATURE] Expose status conditions as Prometheus metrics for
Prometheus,PrometheusAgent,Alertmanager, andThanosRulerresources (prometheus_operator_<resource>_status_condition). #8719 - [ENHANCEMENT] Tighten the operator's ClusterRole by replacing wildcard verbs with explicit permissions per resource. #8752
- [ENHANCEMENT] Support
webhook_url_filefor Discord receiver in Alertmanager configuration Secret (requires Alertmanager >= v0.28.0). #8035 - [BUGFIX] Require Thanos >= v0.42.0 for delayed compaction with object storage uploads, raised from v0.41.0. Thanos v0.41.0 mis-validates the delayed-compaction paths and the sidecar crash-loops; deployments pinned to v0.41.0 fall back to disabling local compaction. #8764
- [BUGFIX] Add URL validation for Mattermost receiver fields in Alertmanager configuration Secret. #8225
- [BUGFIX] Fix operator panic when
AlertmanagerConfigPushover receivers useuserKeyFileortokenFileinstead of secret selectors. #8775 - [BUGFIX] Fix operator panic when kubelet Service synchronization fails and the service is unavailable. #8743
- [BUGFIX] Fix resources stuck during deletion when the informer misses the deletion timestamp update. #8727
- [BUGFIX] Fix
TracingConfigfields inPrometheusCRD not being serialized due to invalid JSON struct tags. #8730 - [BUGFIX] Fix
externalIdversion gating for Alertmanager SigV4 configuration to require version >= v0.34.0 (was incorrectly set to v0.33.0). #8759
v0.93.0
CompareGitHub
- [CHANGE] Switch from uint to int types in the Go definition of the CRDs and add API validations to reject negative values. #8662 #8666
- [CHANGE] Keep local Prometheus compaction enabled when the Thanos sidecar uploads to object storage, for Prometheus >= v3.9.0 and Thanos >= v0.41.0. The operator now coordinates uploads through the shipper meta file (
--storage.tsdb.delay-compact-file.path,--shipper.meta-file-name,--shipper.ignore-unequal-block-size) instead of disabling compaction. Setspec.disableCompaction: trueto keep the previous behavior. #8694 - [CHANGE] Define a default value of 1 for
.spec.shardsforPrometheusandPrometheusAgentCRDs. #8691 - [CHANGE/BUGFIX] Add validation markers to all unsigned int fields to reject negative values. #8662
- [CHANGE/BUGFIX] Disable metadata sending when the remote-write configuration uses message version v2.0. #8700
- [FEATURE] Add
updateMessagefield to the Slack receiver in theAlertmanagerConfigCRD. #8506 - [FEATURE] Add
chunkEncodingfield toTSDBSpecfor runtime float encoding selection inPrometheusandPrometheusAgentCRDs. #8675 - [ENHANCEMENT] Use pod's name as the peer name for Alertmanager >= v0.30.0. #8705
- [BUGFIX] Create IPv6 EndpointSlice for the
kubeletService on dual-stack clusters. #8682
v0.92.0
CompareGitHub
[!NOTE] The
PrometheusTopologyShardingandPrometheusShardRetentionPolicyfeature gates have been promoted to Beta in this release and are now enabled by default. See the sharding documentation for details.
- [CHANGE] Add URL validation for the
tokenUrlfield in OAuth2 configuration across all CRDs. #8579 - [CHANGE] Add URL validation for the
urlfield inRemoteReadSpecinPrometheusCRD. #8596 - [FEATURE] Migrate retention options from CLI flags to the config file for
PrometheusCRD (Prometheus >= v3 uses the config file; older versions continue to use CLI flags). #8547 - [FEATURE] Add
staleSeriesCompactionThresholdfield toTSDBSpecinPrometheusandPrometheusAgentCRDs. #8563 - [FEATURE] Add
labelNameUnderscoreSanitizationandlabelNamePreserveMultipleUnderscoresfields toOTLPConfiginPrometheusandPrometheusAgentCRDs. #8562 - [FEATURE] Add
payloadfield to Webhook receiver inAlertmanagerConfigCRD. #8507 - [ENHANCEMENT] Use pod topology labels for zone sharding on Kubernetes >= 1.35 when the
PrometheusTopologyShardingfeature gate is enabled (removes the need forattachMetadata.node=true). #8564 - [ENHANCEMENT] Add validation for the Slack
update_messagefield in Alertmanager configuration Secret. #8556 - [BUGFIX] Validate target labels in
Probestatic configuration to prevent invalid Prometheus scrape configs. #7901 - [BUGFIX] Fix goroutine leak and data race in
pollBasedListerWatcher. #8593 - [BUGFIX] Validate
ProxyConfigin OAuth2 configuration. #8610 - [BUGFIX] Fix SMTP smarthost format error handling in Alertmanager configuration. #8586
- [BUGFIX] Fix missing
returnin admission webhook after marshal failure. #8582 - [BUGFIX] Fix
FindOwnerto returnnilonmeta.Accessorerror. #8585 - [BUGFIX] Fix dropped gzip
Closeerrors inGzipConfigandGunzipConfig. #8573 - [BUGFIX] Fix panic on malformed key=value flag input (e.g.
--labels "key"). #8560
v0.91.0
CompareGitHub
- [CHANGE] Enforce mutual exclusion of
basicAuth,authorizationandoauth2inScrapeConfigCRD. #8480 - [CHANGE] Add minimum length validations to string fields in
ScrapeConfigCRD. #8479 - [CHANGE] Add validations for VictorOps receiver in
AlertmanagerConfigCRD. #8220 - [CHANGE] Add validations for OpsGenie receiver in
AlertmanagerConfigCRD. #8267 - [CHANGE] Add validations for Email receiver in
AlertmanagerConfigCRD. #8270 - [FEATURE] Implement shard retention based on Prometheus data retention (it requires the
PrometheusShardRetentionPolicyfeature gate). #8478 - [FEATURE] Configure node selector when sharding mode is
TopologyforPrometheusandPrometheusAgentcustom resources (it requires thePrometheusTopologyShardingfeature gate). #8486 - [FEATURE] Configure external label with topology information when sharding mode is
TopologyforPrometheusandPrometheusAgentcustom resources (it requires thePrometheusTopologyShardingfeature gate). #8519 - [FEATURE] Distribute scrape targets within topology zones when sharding mode is
TopologyforPrometheusandPrometheusAgentcustom resources (it requires thePrometheusTopologyShardingfeature gate). #8538 - [FEATURE] Add
--promql-optionsCLI argument to the admission-webhook binary. #8531 - [FEATURE] Validate
PrometheusRuleresources selected byPrometheusresources based on the PromQL enabled features. #8545 - [FEATURE] Add workload identity authentication method for AzureSD in
ScrapeConfigCRD. #8489 - [ENHANCEMENT] Support strategic merge patch of container probes when workloads are configured with HTTPS. #8427
- [ENHANCEMENT] Support
auth_secret_filefield for Email receiver in Alertmanager configuration Secret. #8394 - [ENHANCEMENT] Support
smtp_auth_secret_filefield in Alertmanager configuration Secret. #8396 - [ENHANCEMENT] Add
externalIdfield to SigV4 configuration inAlertmanager,Prometheus,PrometheusAgentandThanosRulerCRDs. #8494 - [ENHANCEMENT] Add
cipherSuitessupport for Thanos Sidecars and Rulers. #8524 - [ENHANCEMENT] Add
curvessupport for Thanos Sidecars and Rulers. #8542 - [ENHANCEMENT] Speed up configuration reloads by watching the config file's parent directory. #7366
- [ENHANCEMENT] Support Mattermost global webhook URL support in Alertmanager configuration Secret. #8501
- [ENHANCEMENT] Add Mattermost global webhook URL support in
AlertmanagerCRD. #8503 #8534 - [ENHANCEMENT] Support
payloadfield for Webhook receiver in Alertmanager configuration Secret. #8505 - [ENHANCEMENT] Support attachment fields for Mattermost receiver in Alertmanager configuration Secret. #8508
- [ENHANCEMENT] Support
update_messagefield for Slack receiver in Alertmanager configuration Secret. #8502 - [ENHANCEMENT] Add threading configuration for email receiver in
AlertmanagerConfigCRD. #8400 - [ENHANCEMENT] Add
healthFilterfield for ConsulSD inScrapeConfigCRD. #8529 - [BUGFIX] Ensure that inactive shards don't scrape any targets when the sharding retention policy is
Retain. #8513 - [BUGFIX] Fix Telegram bot token validation in Alertmanager configuration Secret. #8465
v0.90.0
CompareGitHub
- [CHANGE/BUGFIX] Validate that the remote-write URL scheme is either
httporhttps. #8455 - [FEATURE] Add
--repair-policy-for-statefulsetsCLI argument to the operator. It defines how the operator manages StatefulSet's pods stuck at an incorrect revision. Users running Kubernetes v1.35+ are encouraged to enable this feature (see troubleshooting guide). #8443 - [FEATURE] Add
schedulerNamesupport to thePrometheus,PrometheusAgent,AlertmanagerandThanosRulerCRDs. #8451 - [ENHANCEMENT] Add
--web.tls-curvesCLI argument to the operator and admission-webhook binaries. #8385 - [ENHANCEMENT] Support minimum TLS version for Thanos gRPC servers. #8438
- [ENHANCEMENT] Add version label to
ThanosRulerpods. #8441 - [ENHANCEMENT] Add
messageTextsupport for Slack receiver inAlertmanagerConfigCRD. #8374 - [ENHANCEMENT] Add
messageTextsupport for Slack receiver in Alertmanager secret config. #8375 - [ENHANCEMENT] Add
forceImplicitTLSsupport for SMTP email config in Alertmanager secret config. #8384 #8404 - [ENHANCEMENT] Add
forceImplicitTLSsupport for SMTP email config inAlertmanagerConfigCRD. #8386 - [ENHANCEMENT] Add
forceImplicitTLSsupport for SMTP global config in Alertmanager secret config. #8405 - [ENHANCEMENT] Add
forceImplicitTLSsupport for SMTP global config inAlertmanagerCRD. #8406 - [ENHANCEMENT] Add support for global Telegram bot token in
AlertmanagerCRD. #8372 - [ENHANCEMENT] Add
chatIDFilesupport for Telegram receiver in Alertmanager secret config. #8376 - [ENHANCEMENT] Add
wechatAPISecretFilesupport in Alertmanager global config. #8377 - [ENHANCEMENT] Add
authSecretFilesupport for email config in Alertmanager secret config. #8396 - [ENHANCEMENT] Add nested field support for PagerDuty description in Alertmanager secret config. #8402
- [ENHANCEMENT] Add email threading support in Alertmanager secret config. #8388
- [ENHANCEMENT] Add field and label selectors for ConfigMap watches. #8368
- [ENHANCEMENT] Improve ScrapeConfig API consistency and validation. #8422
- [BUGFIX] Fix
ThanosRulerconfig resource status not being updated on initial StatefulSet creation. #8358 - [BUGFIX] Preserve
LastTransitionTimein Prometheus status conditions. #8346 - [BUGFIX] Make Mattermost
textfield optional inAlertmanagerConfigCRD. #8363 - [BUGFIX] Remove nil error wrapping in v1alpha1 duplicate receiver validation. #8379
- [BUGFIX] Aggregate
Availablecondition across Prometheus shards. #8434 - [BUGFIX] Reconcile resources with inconsistent status. #8397
- [BUGFIX] Fix namespace lister/watcher compatibility with Kubernetes v1.35 client-go. #8431
- [BUGFIX] Fix missing OAuth2 field in IonosSDConfig generation. #8433
- [BUGFIX] Fix missing fields in AzureSDConfig. #8444
- [BUGFIX] Validate Microsoft Teams V2 URL in
AlertmanagerConfigCRD. #8227 - [BUGFIX] Fix
labelmaprelabel action rejecting valid replacement values with template variables for Prometheus 2.x. #8337
v0.89.0
CompareGitHub
- [ENHANCEMENT] Add
hostNetworkfield to theAlertmanagerCRD. #8281 - [ENHANCEMENT] Add the
crdsandfull-crdscommands to the operator's binary. #8251 - [ENHANCEMENT] Report deprecated field usage in the
Reconciledcondition type. #8236 - [ENHANCEMENT] Avoid unnecessary reconciliation upon creation of the
ThanosRulerStatefulSet. #8347 - [ENHANCEMENT] Add
bodySizeLimitto the ScrapeConfig CRD. #8348 - [ENHANCEMENT] Support
http_headersfield in the Alertmanager Secret. #8357 - [ENHANCEMENT] Add the
-kubelet-http-metricsflag to enable/disable the HTTP metrics port in the Kubelet endpoint (default=enabled). #8350 - [ENHANCEMENT] Include
operator.prometheus.io/versionannotation in the full version of CRDs. #8279 - [BUGFIX] Validate VictorOps global configuration in the
AlertmanagerCRD. #8020 - [BUGFIX] Validate Jira global configuration in the
AlertmanagerCRD. #8265 - [BUGFIX] Validate VictorOps receiver's URL in the
AlertmanagerConfigCRD. #8258 - [BUGFIX] Validate Webex receiver's URL in the
AlertmanagerConfigCRD. #8255 - [BUGFIX] Validate Jira receiver's URL configuration in the
AlertmanagerConfigCRD. #8230 - [BUGFIX] Validate OpsGenie receiver configuration in the
AlertmanagerConfigCRD. #8267 - [BUGFIX] Validate WeChat receiver configuration in the
AlertmanagerConfigCRD. #8271 - [BUGFIX] Validate SNS receiver configuration in the
AlertmanagerConfigCRD. #8217 - [BUGFIX] Validate Webex global configuration in the
AlertmanagerCRD. #7979 - [BUGFIX] Validate Telegram global configuration in the
AlertmanagerCRD. #8268 - [BUGFIX] Restore statefulset's labels if the creation fails with AlreadyExists. #8343
- [BUGFIX] Fix potential panic due to informer cache races. #8310
- [BUGFIX] Support probers defined with IPv6 addresses in the
ProbeCRD. #8354 - [BUGFIX] Prevent group and repeat intervals with zero duration from breaking Alertmanager. #8126
- [BUGFIX] Propagate all supported RocketChat attributes for
AlertmanagerConfigCRD. #8016 - [BUGFIX] Add URL validation for WeChat receiver. #8256
- [BUGFIX] Add URL validation for SNS receiver. #8259
- [BUGFIX] Fix GCE service discovery for the
ScrapeConfigCRD. #8284 - [BUGFIX] Avoid stale conditions in
Alertmanager,ThanosRuler,PrometheusandPrometheusAgentresources. #8304 - [BUGFIX] Fix race condition when updating rule ConfigMaps. #8290
- [BUGFIX] Fix race condition when patching finalizers. #8323
- [BUGFIX] Reconcile
ScrapeConfigresources when namespace selection changes. #8334
v0.88.1
CompareGitHub
- [BUGFIX] Validate
webhookURLsecret forMSTeamsreceiver inAlertmanagerConfigCRD. #8294 - [BUGFIX] Revert maximum version check for
EC2/LightsailSD inScrapeConfigCRD. #8308 - [BUGFIX] Relax URL validation in
Slackreceiver in AlertmanagerConfig CRD to support Go templates. #8299 #8331 - [BUGFIX] Relax URL validation in
PagerDutyin AlertmanagerConfig CRD to support Go templates. #8319 - [BUGFIX] Relax URL validation in
WebhookConfigin AlertmanagerConfig CRD to support Go templates. #8307 #8317 - [BUGFIX] Relax URL validation in
RocketChatreceiver in AlertmanagerConfig CRD to support Go templates. #8318 - [BUGFIX] Relax URL validation in
Pushoverreceiver in AlertmanagerConfig CRD to support Go templates. #8307 #8316
v0.88.0
CompareGitHub
- [CHANGE] Use narrower selectors for StatefulSet informers in
AlertmanagerandThanosRulercontrollers. It is recommended to upgrade fromv0.85.0(at least). #8246 - [CHANGE] Reject
EC2/LightsailSD for Prometheus >= 3.8.0 inScrapeConfigCRD. #8175 - [FEATURE] Add
podManagementPolicyfield toPrometheus,PrometheusAgent,AlertmanagerandThanosRulerCRDs. #8119 - [FEATURE] Add
updateStrategyfield toPrometheus,PrometheusAgent,AlertmanagerandThanosRulerCRDs. #8202 - [FEATURE] Add
scrapeNativeHistogramsfield toPrometheus,PrometheusAgent,ServiceMonitor,PodMonitor,ProbeandScrapeConfigCRDs. #8102 - [FEATURE] Add
scopefield toAzureADremote write configuration. #8240 - [FEATURE] Add
workloadIdentityfield toAzureADremote write configuration. #7998 - [FEATURE] Add support for PrometheusRule fields
groupLabelsandqueryOffsetinThanosRuler. #8137 - [FEATURE] Add
slackAppTokenandslackAppUrlfields to Alertmanager global config for Slack App support. #8238 - [FEATURE] Add
incident.ioreceiver support toAlertmanagerconfig secret. #8190 #8245 #8228 - [FEATURE] Add
Mattermostreceiver support toAlertmanagerconfig secret. #8188 - [FEATURE] Add
apiTypefield toJirareceiver inAlertmanagerconfig secret. #8218 - [FEATURE] Add
timeoutfield toPagerDutyreceiver inAlertmanagerConfigCRD. #8162 - [FEATURE] Add
timeoutfield toSlackreceiver inAlertmanagerConfigCRD. #8161 - [ENHANCEMENT] Use
minReadySecondsto set--dispatch.start-delayinAlertmanager. #8177 #8201 - [ENHANCEMENT] Expose native histograms in operator metrics. #8194
- [ENHANCEMENT] Add
NoSelectedResourcesreason to status conditions. #8124 - [ENHANCEMENT] Add
enableHttp2andfollowRedirectsfields to HTTP configuration forProbeCRD. #8112 - [ENHANCEMENT] Add CEL validations for
DaemonSetmode inPrometheusAgentCRD (requires thePrometheusAgentDaemonSetFeaturefeaturegate). #7881 - [ENHANCEMENT] Improve validation for
Pushover,PagerDutyandVictorOpsreceivers inAlertmanagerConfigCRD. #8239 #8113 #8220 - [ENHANCEMENT] Add
apiURLvalidation forWeChat,OpsGenieandTelegramreceivers inAlertmanagerConfigCRD. #8196 #8206 #8199 - [ENHANCEMENT] Validate URL fields in
AlertmanagerConfigreceivers (MSTeams,Webhook). #8231 #8125 - [ENHANCEMENT] Validate URL fields in
Alertmanagerconfiguration secret (WeChat,Telegram,Pushoverreceivers). #7977 #8233 #8232
New Contributors
- @MichalTomczakSE made their first contribution in https://github.com/prometheus-operator/prometheus-operator/pull/8144
- @kartikangiras made their first contribution in https://github.com/prometheus-operator/prometheus-operator/pull/8098
- @varundeepsaini made their first contribution in https://github.com/prometheus-operator/prometheus-operator/pull/8207
- @tomlin7 made their first contribution in https://github.com/prometheus-operator/prometheus-operator/pull/8209
- @fluktuid made their first contribution in https://github.com/prometheus-operator/prometheus-operator/pull/8248
README
Prometheus Operator
Build Status Go Reference Latest Release Slack
Overview
The Prometheus Operator provides Kubernetes native deployment and management of Prometheus and related monitoring components. The purpose of this project is to simplify and automate the configuration of a Prometheus based monitoring stack for Kubernetes clusters.
The Prometheus operator includes, but is not limited to, the following features:
Kubernetes Custom Resources: Use Kubernetes custom resources to deploy and manage Prometheus, Alertmanager, and related components.
Simplified Deployment Configuration: Configure the fundamentals of Prometheus like versions, persistence, retention policies, and replicas from a native Kubernetes resource.
Prometheus Target Configuration: Automatically generate monitoring target configurations based on familiar Kubernetes label queries; no need to learn a Prometheus specific configuration language.
For an introduction to the Prometheus Operator, see the getting started guide.
Project Status
The operator in itself is considered to be production ready. Please refer to the Custom Resource Definition (CRD) versions for the status of each CRD:
monitoring.coreos.com/v1: stable CRDs and API, changes are made in a backward-compatible way.monitoring.coreos.com/v1beta1: unstable CRDs and API, changes can happen but the team is focused on avoiding them. We encourage usage in production for users that accept the risk of breaking changes.monitoring.coreos.com/v1alpha1: unstable CRDs and API, changes can happen frequently, and we suggest avoiding its usage on mission-critical environments.
Prometheus Operator vs. kube-prometheus vs. community Helm chart
Prometheus Operator
The Prometheus Operator uses Kubernetes custom resources to simplify the deployment and configuration of Prometheus, Alertmanager, and related monitoring components.
kube-prometheus
kube-prometheus provides example configurations for a complete cluster monitoring stack based on Prometheus and the Prometheus Operator. This includes deployment of multiple Prometheus and Alertmanager instances, metrics exporters such as the node_exporter for gathering node metrics, scrape target configuration linking Prometheus to various metrics endpoints, and example alerting rules for notification of potential issues in the cluster.
Helm chart
The prometheus-community/kube-prometheus-stack Helm chart provides a similar feature set to kube-prometheus. This chart is maintained by the Prometheus community. For more information, please see the chart's readme
Prerequisites
The Prometheus Operator requires at least Kubernetes version 1.16.0. If you
are just starting out with the Prometheus Operator, it is highly recommended to
use the latest stable
release.
CustomResourceDefinitions
A core feature of the Prometheus Operator is to monitor the Kubernetes API server for changes to specific objects and ensure that the current Prometheus deployments match these objects. The Operator acts on the following Custom Resource Definitions (CRDs):
Prometheus, which defines a desired Prometheus deployment.PrometheusAgent, which defines a desired Prometheus deployment, but running in Agent mode.Alertmanager, which defines a desired Alertmanager deployment.ThanosRuler, which defines a desired Thanos Ruler deployment.ServiceMonitor, which declaratively specifies how groups of Kubernetes services should be monitored. The Operator automatically generates Prometheus scrape configuration based on the current state of the objects in the API server.PodMonitor, which declaratively specifies how group of pods should be monitored. The Operator automatically generates Prometheus scrape configuration based on the current state of the objects in the API server.Probe, which declaratively specifies how groups of ingresses or static targets should be monitored. The Operator automatically generates Prometheus scrape configuration based on the definition.ScrapeConfig, which declaratively specifies scrape configurations to be added to Prometheus. This CustomResourceDefinition helps with scraping resources outside the Kubernetes cluster.PrometheusRule, which defines a desired set of Prometheus alerting and/or recording rules. The Operator generates a rule file, which can be used by Prometheus instances.AlertmanagerConfig, which declaratively specifies subsections of the Alertmanager configuration, allowing routing of alerts to custom receivers, and setting inhibit rules.
The Prometheus operator automatically detects changes in the Kubernetes API server to any of the above objects, and ensures that matching deployments and configurations are kept in sync.
To learn more about the CRDs introduced by the Prometheus Operator have a look at the design page.
Dynamic Admission Control
To prevent invalid Prometheus alerting and recording rules from causing failures in a deployed Prometheus instance,
an admission webhook
is provided to validate PrometheusRule resources upon initial creation or update.
For more information on this feature, see the user guide.
Quickstart
Note: this quickstart does not provision an entire monitoring stack; if that is what you are looking for,
see the kube-prometheus project. If you want the whole stack,
but have already applied the bundle.yaml, delete the bundle first (kubectl delete -f bundle.yaml).
To quickly try out just the Prometheus Operator inside a cluster, choose a release and run the following command which deploys the operator in the default namespace:
kubectl create -f bundle.yamlIf you want to deploy the Prometheus operator in a different namespace, you also need kustomize:
NAMESPACE=my_namespace kustomize edit set namespace $NAMESPACE && kubectl create -k .Note: make sure to adapt the namespace in the ClusterRoleBinding if deploying in a namespace other than the default namespace.
To run the Operator outside of a cluster:
make
scripts/run-external.sh <kubectl cluster name>Removal
To remove the operator and Prometheus, first delete any custom resources you created in each namespace. The operator will automatically shut down and remove Prometheus and Alertmanager pods, and associated ConfigMaps.
for n in $(kubectl get namespaces -o jsonpath={..metadata.name}); do
kubectl delete --all --namespace=$n prometheus,servicemonitor,podmonitor,alertmanager
doneAfter a couple of minutes you can go ahead and remove the operator itself.
kubectl delete -f bundle.yamlThe operator automatically creates services in each namespace where you created a Prometheus or Alertmanager resources, and defines three custom resource definitions. You can clean these up now.
for n in $(kubectl get namespaces -o jsonpath={..metadata.name}); do
kubectl delete --ignore-not-found --namespace=$n service prometheus-operated alertmanager-operated
done
kubectl delete --ignore-not-found customresourcedefinitions \
prometheuses.monitoring.coreos.com \
servicemonitors.monitoring.coreos.com \
podmonitors.monitoring.coreos.com \
alertmanagers.monitoring.coreos.com \
prometheusrules.monitoring.coreos.com \
alertmanagerconfigs.monitoring.coreos.com \
scrapeconfigs.monitoring.coreos.comTesting
See TESTING
Contributing
See CONTRIBUTING.
AI Usage Policy
See AI Usage Policy in our Contributing guidelines for information on using AI tools when contributing to the project.
Security
If you find a security vulnerability related to the Prometheus Operator which isn't already publicly disclosed, please do not report it by opening a GitHub issue, but instead please send an e-mail to the maintainers of the project found in the MAINTAINERS.md file.
Please refer to the Prometheus documentation when reporting issues from automated security scanners.
Troubleshooting
Check the troubleshooting documentation for common issues and frequently asked questions (FAQ).
Acknowledgements
prometheus-operator organization logo was created and contributed by Bianca Cheng Costanzo.