...
1apiVersion: apiextensions.k8s.io/v1
2kind: CustomResourceDefinition
3metadata:
4 annotations:
5 api-approved.openshift.io: https://github.com/openshift/api/pull/1179
6 description: OpenShift Monitoring alerting rules
7 release.openshift.io/feature-set: TechPreviewNoUpgrade
8 name: alertingrules.monitoring.openshift.io
9spec:
10 group: monitoring.openshift.io
11 names:
12 kind: AlertingRule
13 listKind: AlertingRuleList
14 plural: alertingrules
15 singular: alertingrule
16 scope: Namespaced
17 versions:
18 - name: v1alpha1
19 schema:
20 openAPIV3Schema:
21 description: "AlertingRule represents a set of user-defined Prometheus rule groups containing alerting rules. This resource is the supported method for cluster admins to create alerts based on metrics recorded by the platform monitoring stack in OpenShift, i.e. the Prometheus instance deployed to the openshift-monitoring namespace. You might use this to create custom alerting rules not shipped with OpenShift based on metrics from components such as the node_exporter, which provides machine-level metrics such as CPU usage, or kube-state-metrics, which provides metrics on Kubernetes usage. \n The API is mostly compatible with the upstream PrometheusRule type from the prometheus-operator. The primary difference being that recording rules are not allowed here -- only alerting rules. For each AlertingRule resource created, a corresponding PrometheusRule will be created in the openshift-monitoring namespace. OpenShift requires admins to use the AlertingRule resource rather than the upstream type in order to allow better OpenShift specific defaulting and validation, while not modifying the upstream APIs directly. \n You can find upstream API documentation for PrometheusRule resources here: \n https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md \n Compatibility level 4: No compatibility is provided, the API can change at any point for any reason. These capabilities should not be used by applications needing long term support."
22 type: object
23 required:
24 - spec
25 properties:
26 apiVersion:
27 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'
28 type: string
29 kind:
30 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'
31 type: string
32 metadata:
33 type: object
34 spec:
35 description: spec describes the desired state of this AlertingRule object.
36 type: object
37 required:
38 - groups
39 properties:
40 groups:
41 description: "groups is a list of grouped alerting rules. Rule groups are the unit at which Prometheus parallelizes rule processing. All rules in a single group share a configured evaluation interval. All rules in the group will be processed together on this interval, sequentially, and all rules will be processed. \n It's common to group related alerting rules into a single AlertingRule resources, and within that resource, closely related alerts, or simply alerts with the same interval, into individual groups. You are also free to create AlertingRule resources with only a single rule group, but be aware that this can have a performance impact on Prometheus if the group is extremely large or has very complex query expressions to evaluate. Spreading very complex rules across multiple groups to allow them to be processed in parallel is also a common use-case."
42 type: array
43 minItems: 1
44 items:
45 description: RuleGroup is a list of sequentially evaluated alerting rules.
46 type: object
47 required:
48 - name
49 - rules
50 properties:
51 interval:
52 description: "interval is how often rules in the group are evaluated. If not specified, it defaults to the global.evaluation_interval configured in Prometheus, which itself defaults to 30 seconds. You can check if this value has been modified from the default on your cluster by inspecting the platform Prometheus configuration: \n $ oc -n openshift-monitoring describe prometheus k8s \n The relevant field in that resource is: spec.evaluationInterval \n This is represented as a Prometheus duration, e.g. 1d, 1h30m, 5m, 10s. You can find the upstream documentation here: \n https://prometheus.io/docs/prometheus/latest/configuration/configuration/#duration"
53 type: string
54 pattern: ^(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?$
55 name:
56 description: name is the name of the group.
57 type: string
58 rules:
59 description: rules is a list of sequentially evaluated alerting rules. Prometheus may process rule groups in parallel, but rules within a single group are always processed sequentially, and all rules are processed.
60 type: array
61 minItems: 1
62 items:
63 description: 'Rule describes an alerting rule. See Prometheus documentation: - https://www.prometheus.io/docs/prometheus/latest/configuration/alerting_rules'
64 type: object
65 required:
66 - alert
67 - expr
68 properties:
69 alert:
70 description: alert is the name of the alert. Must be a valid label value, i.e. only contain ASCII letters, numbers, and underscores.
71 type: string
72 pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
73 annotations:
74 description: "annotations to add to each alert. These are values that can be used to store longer additional information that you won't query on, such as alert descriptions or runbook links, e.g.: \n annotations: summary: HAProxy reload failure description: | This alert fires when HAProxy fails to reload its configuration, which will result in the router not picking up recently created or modified routes."
75 type: object
76 additionalProperties:
77 type: string
78 expr:
79 description: "expr is the PromQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending or firing alerts. This is most often a string representing a PromQL expression, e.g.: \n mapi_current_pending_csr > mapi_max_pending_csr \n In rare cases this could be a simple integer, e.g. a simple \"1\" if the intent is to create an alert that is always firing. This is sometimes used to create an always-firing \"Watchdog\" alert in order to ensure the alerting pipeline is functional."
80 anyOf:
81 - type: integer
82 - type: string
83 x-kubernetes-int-or-string: true
84 for:
85 description: 'for is the time period after which alerts are considered firing after first returning results. Alerts which have not yet fired for long enough are considered pending. This is represented as a Prometheus duration, for details on the format see: - https://prometheus.io/docs/prometheus/latest/configuration/configuration/#duration'
86 type: string
87 pattern: ^(([0-9]+)y)?(([0-9]+)w)?(([0-9]+)d)?(([0-9]+)h)?(([0-9]+)m)?(([0-9]+)s)?(([0-9]+)ms)?$
88 labels:
89 description: "labels to add or overwrite for each alert. The results of the PromQL expression for the alert will result in an existing set of labels for the alert, after evaluating the expression, for any label specified here with the same name as a label in that set, the label here wins and overwrites the previous value. These should typically be short identifying values that may be useful to query against. A common example is the alert severity: \n labels: severity: warning"
90 type: object
91 additionalProperties:
92 type: string
93 x-kubernetes-list-map-keys:
94 - name
95 x-kubernetes-list-type: map
96 status:
97 description: status describes the current state of this AlertOverrides object.
98 type: object
99 properties:
100 observedGeneration:
101 description: observedGeneration is the last generation change you've dealt with.
102 type: integer
103 format: int64
104 prometheusRule:
105 description: prometheusRule is the generated PrometheusRule for this AlertingRule. Each AlertingRule instance results in a generated PrometheusRule object in the same namespace, which is always the openshift-monitoring namespace.
106 type: object
107 required:
108 - name
109 properties:
110 name:
111 description: name of the referenced PrometheusRule.
112 type: string
113 served: true
114 storage: true
115 subresources:
116 status: {}
117status:
118 acceptedNames:
119 kind: ""
120 plural: ""
121 conditions: []
122 storedVersions: []
View as plain text