v1alpha1

package
v0.0.16 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the rca v1alpha1 API group. +kubebuilder:object:generate=true +groupName=rca.rca-operator.tech

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "rca.rca-operator.tech", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

This section is empty.

Types

type AffectedResource

type AffectedResource struct {
	// apiVersion is the resource API version when known.
	// +optional
	APIVersion string `json:"apiVersion,omitempty"`

	// kind is the resource kind (e.g. Deployment, Pod, Node).
	// +kubebuilder:validation:Required
	Kind string `json:"kind"`

	// name is the resource name.
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// namespace is the resource namespace. Empty for cluster-scoped resources.
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// uid is the Kubernetes UID when known.
	// +optional
	UID string `json:"uid,omitempty"`
}

AffectedResource identifies a Kubernetes resource involved in an incident.

func (*AffectedResource) DeepCopy

func (in *AffectedResource) DeepCopy() *AffectedResource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AffectedResource.

func (*AffectedResource) DeepCopyInto

func (in *AffectedResource) DeepCopyInto(out *AffectedResource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AttributeMatch added in v0.0.16

type AttributeMatch struct {
	// key is the attribute name, e.g. "http.status_code" or "service.name".
	// Dotted OTel semantic-convention keys are supported as-is.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	Key string `json:"key"`

	// op is the predicate operator applied to the attribute value.
	//   Equals      — attribute value equals `value`
	//   NotEquals   — attribute value does not equal `value`
	//   Contains    — attribute value contains `value` as a substring
	//   NotContains — attribute value does not contain `value`
	//   Regex       — attribute value matches the RE2 regex in `value`
	//   Exists      — attribute is present with a non-empty value (`value` ignored)
	//   NotExists   — attribute is absent or empty (`value` ignored)
	//   Gte/Lte/Gt/Lt — numeric comparison against `value` (parses both sides as float64)
	// +kubebuilder:validation:Enum=Equals;NotEquals;Contains;NotContains;Regex;Exists;NotExists;Gte;Lte;Gt;Lt
	// +kubebuilder:default=Equals
	Op string `json:"op"`

	// value is the comparison target. Ignored for Exists/NotExists.
	// +optional
	Value string `json:"value,omitempty"`
}

AttributeMatch is a single key/value predicate applied to an event's attributes map. It is used by RuleCondition.Attributes to match against OTel resource/span/log attributes (e.g. http.status_code, service.name).

func (*AttributeMatch) DeepCopy added in v0.0.16

func (in *AttributeMatch) DeepCopy() *AttributeMatch

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttributeMatch.

func (*AttributeMatch) DeepCopyInto added in v0.0.16

func (in *AttributeMatch) DeepCopyInto(out *AttributeMatch)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type IncidentObjectRef added in v0.0.5

type IncidentObjectRef struct {
	// apiVersion is the resource API version.
	// +optional
	APIVersion string `json:"apiVersion,omitempty"`

	// kind is the Kubernetes kind.
	// +kubebuilder:validation:Required
	Kind string `json:"kind"`

	// namespace is empty for cluster-scoped resources.
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// name is the Kubernetes object name.
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// uid is the Kubernetes UID when known.
	// +optional
	UID string `json:"uid,omitempty"`
}

IncidentObjectRef is a normalized reference to a Kubernetes resource.

func (*IncidentObjectRef) DeepCopy added in v0.0.5

func (in *IncidentObjectRef) DeepCopy() *IncidentObjectRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IncidentObjectRef.

func (*IncidentObjectRef) DeepCopyInto added in v0.0.5

func (in *IncidentObjectRef) DeepCopyInto(out *IncidentObjectRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type IncidentReport

type IncidentReport struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is a standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitzero"`

	// spec defines the desired state of IncidentReport
	// +required
	Spec IncidentReportSpec `json:"spec"`

	// status defines the observed state of IncidentReport
	// +optional
	Status IncidentReportStatus `json:"status,omitzero"`
}

IncidentReport is the Schema for the incidentreports API

func (*IncidentReport) DeepCopy

func (in *IncidentReport) DeepCopy() *IncidentReport

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IncidentReport.

func (*IncidentReport) DeepCopyInto

func (in *IncidentReport) DeepCopyInto(out *IncidentReport)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*IncidentReport) DeepCopyObject

func (in *IncidentReport) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type IncidentReportList

type IncidentReportList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitzero"`
	Items           []IncidentReport `json:"items"`
}

IncidentReportList contains a list of IncidentReport

func (*IncidentReportList) DeepCopy

func (in *IncidentReportList) DeepCopy() *IncidentReportList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IncidentReportList.

func (*IncidentReportList) DeepCopyInto

func (in *IncidentReportList) DeepCopyInto(out *IncidentReportList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*IncidentReportList) DeepCopyObject

func (in *IncidentReportList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type IncidentReportSpec

type IncidentReportSpec struct {
	// agentRef is the name of the RCAAgent that created this report.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	AgentRef string `json:"agentRef"`

	// fingerprint is the canonical identity for an incident.
	// It is stable across repeated signals for the same underlying issue.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	Fingerprint string `json:"fingerprint"`

	// incidentType is the durable incident category.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	IncidentType string `json:"incidentType"`

	// scope describes the primary object or workload the incident belongs to.
	// +optional
	Scope IncidentScope `json:"scope,omitempty"`
}

IncidentReportSpec defines the desired state of IncidentReport. In Phase 1 the CR is written by the operator — users do not submit specs directly.

func (*IncidentReportSpec) DeepCopy

func (in *IncidentReportSpec) DeepCopy() *IncidentReportSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IncidentReportSpec.

func (*IncidentReportSpec) DeepCopyInto

func (in *IncidentReportSpec) DeepCopyInto(out *IncidentReportSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type IncidentReportStatus

type IncidentReportStatus struct {
	// severity is the incident severity level assigned by the incident engine.
	// +kubebuilder:validation:Enum=P1;P2;P3;P4
	// +required
	Severity string `json:"severity,omitempty"`

	// phase is the current lifecycle phase of the incident.
	// +kubebuilder:validation:Enum=Detecting;Active;Resolved
	// +required
	Phase string `json:"phase,omitempty"`

	// incidentType is the category of incident detected by the incident engine.
	// The value is self-describing from the raw event type (e.g. CrashLoopBackOff,
	// OOMKilled, ImagePullBackOff, NodeNotReady) rather than a fixed enum.
	// +required
	IncidentType string `json:"incidentType,omitempty"`

	// summary is the short dashboard-friendly summary for the current incident state.
	// +optional
	Summary string `json:"summary,omitempty"`

	// reason is the machine-oriented Kubernetes reason when available.
	// +optional
	Reason string `json:"reason,omitempty"`

	// message is the detailed message for the most recent signal.
	// +optional
	Message string `json:"message,omitempty"`

	// firstObservedAt is when the incident fingerprint was first seen in the current lifecycle.
	// +optional
	FirstObservedAt *metav1.Time `json:"firstObservedAt,omitempty"`

	// activeAt is when the incident crossed the stabilization window and became Active.
	// +optional
	ActiveAt *metav1.Time `json:"activeAt,omitempty"`

	// lastObservedAt is when the most recent confirming signal was received.
	// +optional
	LastObservedAt *metav1.Time `json:"lastObservedAt,omitempty"`

	// startTime is when the incident was first detected.
	// Deprecated: use firstObservedAt. Retained only for compatibility with older clients.
	// +required
	StartTime *metav1.Time `json:"startTime,omitempty"`

	// resolvedTime is when the incident was resolved. Empty while still active.
	// Deprecated: use resolvedAt. Retained only for compatibility with older clients.
	// +optional
	ResolvedTime *metav1.Time `json:"resolvedTime,omitempty"`

	// resolvedAt is when the incident was resolved.
	// +optional
	ResolvedAt *metav1.Time `json:"resolvedAt,omitempty"`

	// signalCount is the number of confirming signals recorded in the current lifecycle.
	// +optional
	SignalCount int64 `json:"signalCount,omitempty"`

	// stabilizationWindowSeconds is the required continuous observation window before Active.
	// +optional
	StabilizationWindowSeconds int64 `json:"stabilizationWindowSeconds,omitempty"`

	// notified indicates whether the notification layer (Slack / PagerDuty) has
	// already fired for this incident. Used to suppress duplicate alerts.
	// +optional
	Notified bool `json:"notified,omitempty"`

	// affectedResources lists the Kubernetes resources involved in this incident.
	// +required
	// +listType=atomic
	AffectedResources []AffectedResource `json:"affectedResources,omitempty"`

	// correlatedSignals is the list of raw signals that triggered this incident
	// (e.g. "CrashLoopBackOff (restarts: 8)", "OOMKilled (exit code 137)").
	// +required
	// +listType=atomic
	CorrelatedSignals []string `json:"correlatedSignals,omitempty"`

	// timeline is the ordered sequence of events that make up this incident.
	// +required
	// +listType=atomic
	Timeline []TimelineEvent `json:"timeline,omitempty"`

	// conditions represent the current state of the IncidentReport resource.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// incidentGraph is the serialized incident topology graph — nodes for
	// the affected Kubernetes resources + services observed via OTel spans,
	// and edges for ownership, scheduling, and service-to-service calls. It
	// is written by the controller on transition to Active and pruned by the
	// retention subsystem after incidentRetention/4 to keep etcd footprint
	// bounded. Clients should treat the payload as opaque JSON; the
	// schema is defined by internal/correlator/graph.IncidentGraph.
	// +optional
	IncidentGraph *runtime.RawExtension `json:"incidentGraph,omitempty"`
}

IncidentReportStatus defines the observed state of IncidentReport.

func (*IncidentReportStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IncidentReportStatus.

func (*IncidentReportStatus) DeepCopyInto

func (in *IncidentReportStatus) DeepCopyInto(out *IncidentReportStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type IncidentScope added in v0.0.5

type IncidentScope struct {
	// level is one of Cluster, Namespace, Workload, or Pod.
	// +kubebuilder:validation:Enum=Cluster;Namespace;Workload;Pod
	// +optional
	Level string `json:"level,omitempty"`

	// namespace is populated for namespace-, workload-, and pod-scoped incidents.
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// workloadRef points at the top-level workload when the issue belongs to one.
	// +optional
	WorkloadRef *IncidentObjectRef `json:"workloadRef,omitempty"`

	// resourceRef points at the primary affected object.
	// +optional
	ResourceRef *IncidentObjectRef `json:"resourceRef,omitempty"`
}

IncidentScope identifies the primary scope for an incident.

func (*IncidentScope) DeepCopy added in v0.0.5

func (in *IncidentScope) DeepCopy() *IncidentScope

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IncidentScope.

func (*IncidentScope) DeepCopyInto added in v0.0.5

func (in *IncidentScope) DeepCopyInto(out *IncidentScope)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NotificationsConfig

type NotificationsConfig struct {
	// Slack holds the configuration for Slack notifications.
	// +optional
	Slack *SlackConfig `json:"slack,omitempty"`

	// PagerDuty holds the configuration for PagerDuty notifications.
	// +optional
	PagerDuty *PagerDutyConfig `json:"pagerduty,omitempty"`
}

NotificationsConfig defines where to send RCAAgent notifications.

func (*NotificationsConfig) DeepCopy

func (in *NotificationsConfig) DeepCopy() *NotificationsConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NotificationsConfig.

func (*NotificationsConfig) DeepCopyInto

func (in *NotificationsConfig) DeepCopyInto(out *NotificationsConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type OTelConfig added in v0.0.5

type OTelConfig struct {
	// Endpoint is the OTLP gRPC collector address (e.g. "otel-collector.observability.svc.cluster.local:4317").
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	Endpoint string `json:"endpoint"`

	// ServiceName is the service.name resource attribute. Defaults to "rca-operator".
	// +optional
	ServiceName string `json:"serviceName,omitempty"`

	// SamplingRate is the trace sampling ratio as a string (e.g. "1.0"). Defaults to "1.0".
	// +optional
	SamplingRate string `json:"samplingRate,omitempty"`

	// Insecure disables TLS on the gRPC connection (typical for in-cluster collectors).
	// +optional
	Insecure bool `json:"insecure,omitempty"`
}

OTelConfig holds OpenTelemetry export settings.

func (*OTelConfig) DeepCopy added in v0.0.5

func (in *OTelConfig) DeepCopy() *OTelConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OTelConfig.

func (*OTelConfig) DeepCopyInto added in v0.0.5

func (in *OTelConfig) DeepCopyInto(out *OTelConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type PagerDutyConfig

type PagerDutyConfig struct {
	// SecretRef is the name of the Kubernetes Secret containing the PagerDuty Events API v2 key.
	// The secret must have a key named "apiKey".
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:example=pd-api-key
	SecretRef string `json:"secretRef"`

	// Severity is the minimum incident severity that triggers a PagerDuty page.
	// +kubebuilder:validation:Enum=P1;P2;P3;P4
	// +kubebuilder:default=P2
	// +optional
	Severity string `json:"severity,omitempty"`
}

PagerDutyConfig holds PagerDuty-specific notification settings.

func (*PagerDutyConfig) DeepCopy

func (in *PagerDutyConfig) DeepCopy() *PagerDutyConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PagerDutyConfig.

func (*PagerDutyConfig) DeepCopyInto

func (in *PagerDutyConfig) DeepCopyInto(out *PagerDutyConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RCAAgent

type RCAAgent struct {
	metav1.TypeMeta `json:",inline"`

	// metadata is a standard object metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitzero"`

	// spec defines the desired state of RCAAgent
	// +required
	Spec RCAAgentSpec `json:"spec"`

	// status defines the observed state of RCAAgent
	// +optional
	Status RCAAgentStatus `json:"status,omitzero"`
}

RCAAgent is the Schema for the rcaagents API

func (*RCAAgent) DeepCopy

func (in *RCAAgent) DeepCopy() *RCAAgent

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RCAAgent.

func (*RCAAgent) DeepCopyInto

func (in *RCAAgent) DeepCopyInto(out *RCAAgent)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RCAAgent) DeepCopyObject

func (in *RCAAgent) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RCAAgentList

type RCAAgentList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitzero"`
	Items           []RCAAgent `json:"items"`
}

RCAAgentList contains a list of RCAAgent

func (*RCAAgentList) DeepCopy

func (in *RCAAgentList) DeepCopy() *RCAAgentList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RCAAgentList.

func (*RCAAgentList) DeepCopyInto

func (in *RCAAgentList) DeepCopyInto(out *RCAAgentList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RCAAgentList) DeepCopyObject

func (in *RCAAgentList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RCAAgentSpec

type RCAAgentSpec struct {

	// watchNamespaces specifies the namespaces that the RCAAgent should monitor.
	// +kubebuilder:validation:Required
	// +kubebuilder:default={"default"}
	// +kubebuilder:example={"production","staging"}
	WatchNamespaces []string `json:"watchNamespaces,omitempty"`

	// Notifications holds the configuration for sending incident notifications.
	// +optional
	Notifications *NotificationsConfig `json:"notifications,omitempty"`

	// IncidentRetention specifies how long to keep Resolved IncidentReport CRs before pruning.
	// Supported suffixes: m (minutes), h (hours), d (days), for example "5m", "12h", "30d".
	// +kubebuilder:validation:Pattern=`^[1-9][0-9]*(m|h|d)$`
	// +kubebuilder:default="30d"
	// +optional
	IncidentRetention string `json:"incidentRetention,omitempty"`

	// IncidentRetentionDays is deprecated. Use incidentRetention instead.
	// This field is retained for backward compatibility.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:default=30
	// +optional
	IncidentRetentionDays int `json:"incidentRetentionDays,omitempty"`

	// OTel holds optional OpenTelemetry configuration for exporting traces to an OTLP collector.
	// +optional
	OTel *OTelConfig `json:"otel,omitempty"`

	// SignalMappings allows overriding the default event-type → incident-type mapping.
	// +optional
	SignalMappings []SignalMappingConfig `json:"signalMappings,omitempty"`
}

RCAAgentSpec defines the desired state of RCAAgent

func (*RCAAgentSpec) DeepCopy

func (in *RCAAgentSpec) DeepCopy() *RCAAgentSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RCAAgentSpec.

func (*RCAAgentSpec) DeepCopyInto

func (in *RCAAgentSpec) DeepCopyInto(out *RCAAgentSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RCAAgentStatus

type RCAAgentStatus struct {

	// conditions represent the current state of the RCAAgent resource.
	// Each condition has a unique type and reflects the status of a specific aspect of the resource.
	//
	// Standard condition types include:
	// - "Available": the resource is fully functional
	// - "Progressing": the resource is being created or updated
	// - "Degraded": the resource failed to reach or maintain its desired state
	//
	// The status of each condition is one of True, False, or Unknown.
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

RCAAgentStatus defines the observed state of RCAAgent.

func (*RCAAgentStatus) DeepCopy

func (in *RCAAgentStatus) DeepCopy() *RCAAgentStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RCAAgentStatus.

func (*RCAAgentStatus) DeepCopyInto

func (in *RCAAgentStatus) DeepCopyInto(out *RCAAgentStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RCACorrelationRule added in v0.0.5

type RCACorrelationRule struct {
	metav1.TypeMeta `json:",inline"`

	// +optional
	metav1.ObjectMeta `json:"metadata,omitzero"`

	// +required
	Spec RCACorrelationRuleSpec `json:"spec"`
}

RCACorrelationRule is a cluster-scoped CRD that defines a declarative correlation rule for the RCA Operator rule engine.

func (*RCACorrelationRule) DeepCopy added in v0.0.5

func (in *RCACorrelationRule) DeepCopy() *RCACorrelationRule

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RCACorrelationRule.

func (*RCACorrelationRule) DeepCopyInto added in v0.0.5

func (in *RCACorrelationRule) DeepCopyInto(out *RCACorrelationRule)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RCACorrelationRule) DeepCopyObject added in v0.0.5

func (in *RCACorrelationRule) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RCACorrelationRuleList added in v0.0.5

type RCACorrelationRuleList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitzero"`
	Items           []RCACorrelationRule `json:"items"`
}

RCACorrelationRuleList contains a list of RCACorrelationRule.

func (*RCACorrelationRuleList) DeepCopy added in v0.0.5

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RCACorrelationRuleList.

func (*RCACorrelationRuleList) DeepCopyInto added in v0.0.5

func (in *RCACorrelationRuleList) DeepCopyInto(out *RCACorrelationRuleList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RCACorrelationRuleList) DeepCopyObject added in v0.0.5

func (in *RCACorrelationRuleList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type RCACorrelationRuleSpec added in v0.0.5

type RCACorrelationRuleSpec struct {
	// priority controls evaluation order. Higher values are evaluated first.
	// The first rule whose conditions match wins.
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:default=100
	Priority int `json:"priority"`

	// agentSelector restricts which RCAAgents this rule applies to.
	// A nil selector matches all agents.
	// +optional
	AgentSelector *metav1.LabelSelector `json:"agentSelector,omitempty"`

	// trigger is the event type that initiates rule evaluation.
	// +kubebuilder:validation:Required
	Trigger RuleTrigger `json:"trigger"`

	// conditions are additional signals that must be present in the correlation
	// buffer for the rule to fire. All conditions must match (AND logic).
	// +optional
	Conditions []RuleCondition `json:"conditions,omitempty"`

	// fires defines the incident properties when this rule matches.
	// +kubebuilder:validation:Required
	Fires RuleFires `json:"fires"`
}

RCACorrelationRuleSpec defines a declarative correlation rule evaluated by the generic rule engine. Rules are loaded dynamically — no operator redeploy needed.

func (*RCACorrelationRuleSpec) DeepCopy added in v0.0.5

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RCACorrelationRuleSpec.

func (*RCACorrelationRuleSpec) DeepCopyInto added in v0.0.5

func (in *RCACorrelationRuleSpec) DeepCopyInto(out *RCACorrelationRuleSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RuleCondition added in v0.0.5

type RuleCondition struct {
	// eventType is the signal type that must be present.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	EventType string `json:"eventType"`

	// scope defines the relationship between the trigger event and this condition.
	// +kubebuilder:validation:Enum=samePod;sameNode;sameNamespace;sameTrace;any
	// +kubebuilder:default=samePod
	Scope string `json:"scope"`

	// negate inverts the condition: when true the rule fires only if this signal
	// is NOT present in the buffer.
	// +optional
	Negate bool `json:"negate,omitempty"`

	// attributes is an optional list of key/value predicates evaluated against
	// candidate events that implement the AttributesEvent interface (OTel span
	// and log signals). All predicates must match (AND logic). Events that do
	// not expose attributes are treated as having no attributes — any predicate
	// other than `NotExists` fails for such events.
	// +optional
	Attributes []AttributeMatch `json:"attributes,omitempty"`
}

RuleCondition specifies an additional signal that must be present in the buffer.

func (*RuleCondition) DeepCopy added in v0.0.5

func (in *RuleCondition) DeepCopy() *RuleCondition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleCondition.

func (*RuleCondition) DeepCopyInto added in v0.0.5

func (in *RuleCondition) DeepCopyInto(out *RuleCondition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RuleFires added in v0.0.5

type RuleFires struct {
	// incidentType is the canonical incident category.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	IncidentType string `json:"incidentType"`

	// severity is the incident priority level.
	// +kubebuilder:validation:Enum=P1;P2;P3;P4
	// +kubebuilder:validation:Required
	Severity string `json:"severity"`

	// summary is a Go text/template rendered with event context.
	// Available variables: {{.PodName}}, {{.Namespace}}, {{.NodeName}}, {{.EventType}}.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	Summary string `json:"summary"`

	// resource overrides the default resource for incident dedup.
	// Use "node" for node-scoped, "deployment" for deployment-scoped, or leave empty for pod-scoped.
	// +optional
	Resource string `json:"resource,omitempty"`

	// scope overrides the incident scope level.
	// +kubebuilder:validation:Enum=Pod;Workload;Namespace;Cluster
	// +optional
	Scope string `json:"scope,omitempty"`
}

RuleFires defines the incident output when a rule matches.

func (*RuleFires) DeepCopy added in v0.0.5

func (in *RuleFires) DeepCopy() *RuleFires

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleFires.

func (*RuleFires) DeepCopyInto added in v0.0.5

func (in *RuleFires) DeepCopyInto(out *RuleFires)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RuleTrigger added in v0.0.5

type RuleTrigger struct {
	// eventType is one of the watcher EventType constants (e.g. CrashLoopBackOff, OOMKilled).
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	EventType string `json:"eventType"`
}

RuleTrigger identifies the event that starts rule evaluation.

func (*RuleTrigger) DeepCopy added in v0.0.5

func (in *RuleTrigger) DeepCopy() *RuleTrigger

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleTrigger.

func (*RuleTrigger) DeepCopyInto added in v0.0.5

func (in *RuleTrigger) DeepCopyInto(out *RuleTrigger)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SignalMappingConfig added in v0.0.5

type SignalMappingConfig struct {
	// EventType is the watcher event type to override (e.g. "CrashLoopBackOff").
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	EventType string `json:"eventType"`

	// IncidentType overrides the default incident type.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	IncidentType string `json:"incidentType"`

	// Severity overrides the default severity.
	// +kubebuilder:validation:Enum=P1;P2;P3;P4
	// +optional
	Severity string `json:"severity,omitempty"`

	// Scope overrides the default scope level.
	// +kubebuilder:validation:Enum=Pod;Workload;Namespace;Cluster
	// +optional
	Scope string `json:"scope,omitempty"`
}

SignalMappingConfig overrides the default event→incident mapping for a single event type.

func (*SignalMappingConfig) DeepCopy added in v0.0.5

func (in *SignalMappingConfig) DeepCopy() *SignalMappingConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SignalMappingConfig.

func (*SignalMappingConfig) DeepCopyInto added in v0.0.5

func (in *SignalMappingConfig) DeepCopyInto(out *SignalMappingConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SlackConfig

type SlackConfig struct {
	// WebhookSecretRef is the name of the Kubernetes Secret containing the Slack webhook URL.
	// The secret must have a key named "webhookURL".
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:example=slack-webhook
	WebhookSecretRef string `json:"webhookSecretRef"`

	// Channel is the Slack channel to post notifications to (e.g. #incidents).
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:example="#incidents"
	Channel string `json:"channel"`

	// MentionOnP1 is the Slack user or group handle to mention on P1 incidents (e.g. @oncall).
	// +optional
	// +kubebuilder:example="@oncall"
	MentionOnP1 string `json:"mentionOnP1,omitempty"`
}

SlackConfig holds Slack-specific notification settings.

func (*SlackConfig) DeepCopy

func (in *SlackConfig) DeepCopy() *SlackConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackConfig.

func (*SlackConfig) DeepCopyInto

func (in *SlackConfig) DeepCopyInto(out *SlackConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TimelineEvent

type TimelineEvent struct {
	// time is the wall-clock time of the event (RFC3339).
	// +kubebuilder:validation:Required
	Time metav1.Time `json:"time"`

	// event is a human-readable description of what happened.
	// +kubebuilder:validation:Required
	Event string `json:"event"`
}

TimelineEvent is a single timestamped entry in the incident timeline.

func (*TimelineEvent) DeepCopy

func (in *TimelineEvent) DeepCopy() *TimelineEvent

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimelineEvent.

func (*TimelineEvent) DeepCopyInto

func (in *TimelineEvent) DeepCopyInto(out *TimelineEvent)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL