186 lines
6.4 KiB
YAML
186 lines
6.4 KiB
YAML
apiVersion: apiextensions.k8s.io/v1
|
|
kind: CustomResourceDefinition
|
|
metadata:
|
|
name: alertrules.rules.alerting.grafana.app
|
|
spec:
|
|
group: rules.alerting.grafana.app
|
|
names:
|
|
kind: AlertRule
|
|
plural: alertrules
|
|
scope: Namespaced
|
|
versions:
|
|
- name: v0alpha1
|
|
schema:
|
|
openAPIV3Schema:
|
|
properties:
|
|
spec:
|
|
properties:
|
|
annotations:
|
|
additionalProperties:
|
|
type: string
|
|
type: object
|
|
execErrState:
|
|
default: Error
|
|
type: string
|
|
expressions:
|
|
additionalProperties:
|
|
properties:
|
|
datasourceUID:
|
|
type: string
|
|
model:
|
|
type: object
|
|
x-kubernetes-preserve-unknown-fields: true
|
|
queryType:
|
|
description: The type of query if this is a query expression
|
|
type: string
|
|
relativeTimeRange:
|
|
properties:
|
|
from:
|
|
type: string
|
|
to:
|
|
type: string
|
|
required:
|
|
- from
|
|
- to
|
|
type: object
|
|
source:
|
|
description: |-
|
|
Used to mark the expression to be used as the final source for the rule evaluation
|
|
Only one expression in a rule can be marked as the source
|
|
For AlertRules, this is the expression that will be evaluated against the alerting condition
|
|
For RecordingRules, this is the expression that will be recorded
|
|
type: boolean
|
|
required:
|
|
- model
|
|
type: object
|
|
description: |-
|
|
TODO: validate that only one can specify source=true
|
|
& struct.MinFields(1) This doesn't work in Cue <v0.12.0 as per
|
|
type: object
|
|
for:
|
|
type: string
|
|
keepFiringFor:
|
|
type: string
|
|
labels:
|
|
additionalProperties:
|
|
type: string
|
|
type: object
|
|
missingSeriesEvalsToResolve:
|
|
minimum: 0
|
|
type: integer
|
|
noDataState:
|
|
default: NoData
|
|
type: string
|
|
notificationSettings:
|
|
properties:
|
|
activeTimeIntervals:
|
|
items:
|
|
description: 'TODO(@moustafab): validate regex for time interval
|
|
ref'
|
|
type: string
|
|
type: array
|
|
groupBy:
|
|
items:
|
|
type: string
|
|
type: array
|
|
groupInterval:
|
|
type: string
|
|
groupWait:
|
|
type: string
|
|
muteTimeIntervals:
|
|
items:
|
|
description: 'TODO(@moustafab): validate regex for time interval
|
|
ref'
|
|
type: string
|
|
type: array
|
|
receiver:
|
|
type: string
|
|
repeatInterval:
|
|
type: string
|
|
required:
|
|
- receiver
|
|
type: object
|
|
panelRef:
|
|
properties:
|
|
dashboardUID:
|
|
minLength: 1
|
|
type: string
|
|
panelID:
|
|
exclusiveMinimum: true
|
|
minimum: 0
|
|
type: integer
|
|
required:
|
|
- dashboardUID
|
|
- panelID
|
|
type: object
|
|
paused:
|
|
type: boolean
|
|
title:
|
|
type: string
|
|
trigger:
|
|
properties:
|
|
interval:
|
|
type: string
|
|
required:
|
|
- interval
|
|
type: object
|
|
required:
|
|
- title
|
|
- trigger
|
|
- noDataState
|
|
- execErrState
|
|
- expressions
|
|
type: object
|
|
status:
|
|
properties:
|
|
additionalFields:
|
|
description: additionalFields is reserved for future use
|
|
type: object
|
|
x-kubernetes-preserve-unknown-fields: true
|
|
operatorStates:
|
|
additionalProperties:
|
|
properties:
|
|
descriptiveState:
|
|
description: descriptiveState is an optional more descriptive
|
|
state field which has no requirements on format
|
|
type: string
|
|
details:
|
|
description: details contains any extra information that is
|
|
operator-specific
|
|
type: object
|
|
x-kubernetes-preserve-unknown-fields: true
|
|
lastEvaluation:
|
|
description: lastEvaluation is the ResourceVersion last evaluated
|
|
type: string
|
|
state:
|
|
description: |-
|
|
state describes the state of the lastEvaluation.
|
|
It is limited to three possible states for machine evaluation.
|
|
enum:
|
|
- success
|
|
- in_progress
|
|
- failed
|
|
type: string
|
|
required:
|
|
- lastEvaluation
|
|
- state
|
|
type: object
|
|
description: |-
|
|
operatorStates is a map of operator ID to operator state evaluations.
|
|
Any operator which consumes this kind SHOULD add its state evaluation information to this field.
|
|
type: object
|
|
type: object
|
|
required:
|
|
- spec
|
|
type: object
|
|
selectableFields:
|
|
- jsonPath: .spec.title
|
|
- jsonPath: .spec.paused
|
|
- jsonPath: .spec.panelRef.dashboardUID
|
|
- jsonPath: .spec.panelRef.panelID
|
|
- jsonPath: .spec.notificationSettings.receiver
|
|
served: true
|
|
storage: true
|
|
subresources:
|
|
status: {}
|