charts/operator/crds/monitoring.googleapis.com_clusterrules.yaml (276 lines of code) (raw):
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.17.1-0.20250103184936-50893dee96da
name: clusterrules.monitoring.googleapis.com
spec:
group: monitoring.googleapis.com
names:
kind: ClusterRules
listKind: ClusterRulesList
plural: clusterrules
singular: clusterrules
scope: Cluster
versions:
- name: v1
schema:
openAPIV3Schema:
description: |-
ClusterRules defines Prometheus alerting and recording rules that are scoped
to the current cluster. Only metric data from the current cluster is processed
and all rule results have their project_id and cluster label preserved
for query processing.
If the location label is not preserved by the rule, it defaults to the cluster's location.
properties:
apiVersion:
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
type: string
kind:
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
type: string
metadata:
type: object
spec:
description: Specification of rules to record and alert on.
properties:
groups:
description: A list of Prometheus rule groups.
items:
description: |-
RuleGroup declares rules in the Prometheus format:
https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/
properties:
interval:
default: 1m
description: The interval at which to evaluate the rules. Must
be a valid Prometheus duration.
format: duration
type: string
name:
description: The name of the rule group.
type: string
rules:
description: A list of rules that are executed sequentially
as part of this group.
items:
description: |-
Rule is a single rule in the Prometheus format:
https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/
properties:
alert:
description: |-
Name of the alert to evaluate the expression as.
Only one of `record` and `alert` must be set.
type: string
annotations:
additionalProperties:
type: string
description: |-
A set of annotations to attach to alerts produced by the query expression.
Only valid if `alert` is set.
type: object
expr:
description: The PromQL expression to evaluate.
type: string
for:
description: |-
The duration to wait before a firing alert produced by this rule is sent to Alertmanager.
Only valid if `alert` is set.
format: duration
type: string
labels:
additionalProperties:
type: string
description: A set of labels to attach to the result of
the query expression.
type: object
record:
description: |-
Record the result of the expression to this metric name.
Only one of `record` and `alert` must be set.
pattern: ^[a-zA-Z_:][a-zA-Z0-9_:]*$
type: string
required:
- expr
type: object
x-kubernetes-validations:
- message: Must set exactly one of Record or Alert
rule: '(has(self.record) ? 1 : 0) + (has(self.alert) ? 1
: 0) == 1'
- message: Annotations are only allowed for alerting rules
rule: '!has(self.annotations) || has(self.alert)'
minItems: 1
type: array
required:
- name
- rules
type: object
type: array
required:
- groups
type: object
status:
description: Most recently observed status of the resource.
properties:
conditions:
description: Represents the latest available observations of a podmonitor's
current state.
items:
description: MonitoringCondition describes the condition of a PodMonitoring.
properties:
lastTransitionTime:
description: Last time the condition transitioned from one status
to another.
format: date-time
type: string
lastUpdateTime:
description: The last time this condition was updated.
format: date-time
type: string
message:
description: A human-readable message indicating details about
the transition.
type: string
reason:
description: The reason for the condition's last transition.
type: string
status:
description: Status of the condition, one of True, False, Unknown.
type: string
type:
description: MonitoringConditionType is the type of MonitoringCondition.
type: string
required:
- status
- type
type: object
type: array
observedGeneration:
description: The generation observed by the controller.
format: int64
type: integer
type: object
required:
- spec
type: object
served: true
storage: true
subresources:
status: {}
- deprecated: true
name: v1alpha1
schema:
openAPIV3Schema:
description: |-
ClusterRules defines Prometheus alerting and recording rules that are scoped
to the current cluster. Only metric data from the current cluster is processed
and all rule results have their project_id and cluster label preserved
for query processing.
If the location label is not preserved by the rule, it defaults to the cluster's location.
properties:
apiVersion:
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
type: string
kind:
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
type: string
metadata:
type: object
spec:
description: Specification of rules to record and alert on.
properties:
groups:
description: A list of Prometheus rule groups.
items:
description: |-
RuleGroup declares rules in the Prometheus format:
https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/
properties:
interval:
description: The interval at which to evaluate the rules. Must
be a valid Prometheus duration.
type: string
name:
description: The name of the rule group.
type: string
rules:
description: A list of rules that are executed sequentially
as part of this group.
items:
description: |-
Rule is a single rule in the Prometheus format:
https://prometheus.io/docs/prometheus/latest/configuration/recording_rules/
properties:
alert:
description: |-
Name of the alert to evaluate the expression as.
Only one of `record` and `alert` must be set.
type: string
annotations:
additionalProperties:
type: string
description: |-
A set of annotations to attach to alerts produced by the query expression.
Only valid if `alert` is set.
type: object
expr:
description: The PromQL expression to evaluate.
type: string
for:
description: |-
The duration to wait before a firing alert produced by this rule is sent to Alertmanager.
Only valid if `alert` is set.
type: string
labels:
additionalProperties:
type: string
description: A set of labels to attach to the result of
the query expression.
type: object
record:
description: |-
Record the result of the expression to this metric name.
Only one of `record` and `alert` must be set.
type: string
required:
- expr
type: object
type: array
required:
- interval
- name
- rules
type: object
type: array
required:
- groups
type: object
status:
description: Most recently observed status of the resource.
type: object
required:
- spec
type: object
served: true
storage: false
subresources:
status: {}