2023-04-14 10:44:57 +00:00
# https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.63.0/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml
2020-12-18 00:46:15 +00:00
---
apiVersion : apiextensions.k8s.io/v1
kind : CustomResourceDefinition
metadata :
annotations :
2023-04-14 10:44:57 +00:00
controller-gen.kubebuilder.io/version : v0.11.1
2020-12-18 00:46:15 +00:00
creationTimestamp : null
name : prometheusrules.monitoring.coreos.com
spec :
group : monitoring.coreos.com
names :
2021-08-25 13:59:17 +00:00
categories :
- prometheus-operator
2020-12-18 00:46:15 +00:00
kind : PrometheusRule
listKind : PrometheusRuleList
plural : prometheusrules
2022-08-24 15:13:39 +00:00
shortNames :
- promrule
2020-12-18 00:46:15 +00:00
singular : prometheusrule
scope : Namespaced
versions :
- name : v1
schema :
openAPIV3Schema :
2021-07-29 11:50:16 +00:00
description : PrometheusRule defines recording and alerting rules for a Prometheus
instance
2020-12-18 00:46:15 +00:00
properties :
apiVersion :
2021-07-29 11:50:16 +00:00
description : 'APIVersion defines the versioned schema of this representation
of an object. Servers should convert recognized schemas to the latest
internal value, and may reject unrecognized values. More info : https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
2020-12-18 00:46:15 +00:00
type : string
kind :
2021-07-29 11:50:16 +00:00
description : 'Kind is a string value representing the REST resource this
object represents. Servers may infer this from the endpoint the client
submits requests to. Cannot be updated. In CamelCase. More info : https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
2020-12-18 00:46:15 +00:00
type : string
metadata :
type : object
spec :
description : Specification of desired alerting rule definitions for Prometheus.
properties :
groups :
description : Content of Prometheus rule file
items :
2023-01-11 12:08:18 +00:00
description : RuleGroup is a list of sequentially evaluated recording
and alerting rules.
2020-12-18 00:46:15 +00:00
properties :
interval :
2023-01-11 12:08:18 +00:00
description : Interval determines how often rules in the group
are evaluated.
pattern : ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$
2020-12-18 00:46:15 +00:00
type : string
name :
2023-01-11 12:08:18 +00:00
description : Name of the rule group.
minLength : 1
2020-12-18 00:46:15 +00:00
type : string
partial_response_strategy :
2023-01-11 12:08:18 +00:00
description : 'PartialResponseStrategy is only used by ThanosRuler
and will be ignored by Prometheus instances. More info : https://github.com/thanos-io/thanos/blob/main/docs/components/rule.md#partial-response'
pattern : ^(?i)(abort|warn)?$
2020-12-18 00:46:15 +00:00
type : string
rules :
2023-01-11 12:08:18 +00:00
description : List of alerting and recording rules.
2020-12-18 00:46:15 +00:00
items :
2021-07-29 11:50:16 +00:00
description : 'Rule describes an alerting or recording rule
See Prometheus documentation : [ alerting](https://www.prometheus.io/docs/prometheus/latest/configuration/alerting_rules/)
or [recording](https://www.prometheus.io/docs/prometheus/latest/configuration/recording_rules/#recording-rules)
rule'
2020-12-18 00:46:15 +00:00
properties :
alert :
2023-01-11 12:08:18 +00:00
description : Name of the alert. Must be a valid label
value. Only one of `record` and `alert` must be set.
2020-12-18 00:46:15 +00:00
type : string
annotations :
additionalProperties :
type : string
2023-01-11 12:08:18 +00:00
description : Annotations to add to each alert. Only valid
for alerting rules.
2020-12-18 00:46:15 +00:00
type : object
expr :
anyOf :
- type : integer
- type : string
2023-01-11 12:08:18 +00:00
description : PromQL expression to evaluate.
2020-12-18 00:46:15 +00:00
x-kubernetes-int-or-string : true
for :
2023-01-11 12:08:18 +00:00
description : Alerts are considered firing once they have
been returned for this long.
pattern : ^(0|(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?)$
2020-12-18 00:46:15 +00:00
type : string
labels :
additionalProperties :
type : string
2023-01-11 12:08:18 +00:00
description : Labels to add or overwrite.
2020-12-18 00:46:15 +00:00
type : object
record :
2023-01-11 12:08:18 +00:00
description : Name of the time series to output to. Must
be a valid metric name. Only one of `record` and `alert`
must be set.
2020-12-18 00:46:15 +00:00
type : string
required :
- expr
type : object
type : array
required :
- name
- rules
type : object
type : array
2023-01-11 12:08:18 +00:00
x-kubernetes-list-map-keys :
- name
x-kubernetes-list-type : map
2020-12-18 00:46:15 +00:00
type : object
required :
- spec
type : object
served : true
storage : true