v1alpha1

package
v0.0.0-...-50dd82c Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RuleFinalizer is the name of the finalizer added to Rule objects
	RuleFinalizer = "mimirrule.finalizers.k8s.healthjoy.com"
)

Variables

View Source
var (
	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

	// AddToScheme is a common registration function for mapping go types to the GroupVersionKind scheme
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: rulescontroller.GroupName, Version: "v1alpha1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type ConditionType

type ConditionType string

ConditionType is a valid value for Condition.Type

const (
	// ConditionTypeReady means the condition is in ready state
	ConditionTypeReady ConditionType = "Ready"
	// ConditionTypeFailed means the condition is in failed state
	ConditionTypeFailed ConditionType = "Failed"
)

type Duration

type Duration string

Duration is a wrapper around string that can hold a duration string.

type MimirRule

type MimirRule struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   RuleSpec   `json:"spec"`
	Status RuleStatus `json:"status"`
}

MimirRule is a specification for a MimirRule resource

func (*MimirRule) DeepCopy

func (in *MimirRule) DeepCopy() *MimirRule

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

func (*MimirRule) DeepCopyInto

func (in *MimirRule) DeepCopyInto(out *MimirRule)

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

func (*MimirRule) DeepCopyObject

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

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

type MimirRuleList

type MimirRuleList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

	Items []MimirRule `json:"items"`
}

MimirRuleList is a list of MimirRule resources

func (*MimirRuleList) DeepCopy

func (in *MimirRuleList) DeepCopy() *MimirRuleList

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

func (*MimirRuleList) DeepCopyInto

func (in *MimirRuleList) DeepCopyInto(out *MimirRuleList)

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

func (*MimirRuleList) DeepCopyObject

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

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

type Rule

type Rule struct {
	Record      string             `json:"record,omitempty"`
	Alert       string             `json:"alert,omitempty"`
	Expr        intstr.IntOrString `json:"expr"`
	For         Duration           `json:"for,omitempty"`
	Labels      map[string]string  `json:"labels,omitempty"`
	Annotations map[string]string  `json:"annotations,omitempty"`
}

Rule is a recording or alerting rule.

func (*Rule) DeepCopy

func (in *Rule) DeepCopy() *Rule

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

func (*Rule) DeepCopyInto

func (in *Rule) DeepCopyInto(out *Rule)

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

type RuleGroup

type RuleGroup struct {
	Name            string   `json:"name"`
	Interval        string   `json:"interval,omitempty"`
	EvaluationDelay string   `json:"evaluation_delay,omitempty"`
	Limit           int      `json:"limit,omitempty"`
	Rules           []Rule   `json:"rules"`
	SourceTenants   []string `json:"source_tenants,omitempty"`
}

RuleGroup is a list of sequentially evaluated recording and alerting rules.

func (*RuleGroup) DeepCopy

func (in *RuleGroup) DeepCopy() *RuleGroup

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

func (*RuleGroup) DeepCopyInto

func (in *RuleGroup) DeepCopyInto(out *RuleGroup)

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

type RuleSpec

type RuleSpec struct {
	Groups []RuleGroup `json:"groups"`
}

RuleSpec is the spec for a MimirRule resource

func (*RuleSpec) DeepCopy

func (in *RuleSpec) DeepCopy() *RuleSpec

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

func (*RuleSpec) DeepCopyInto

func (in *RuleSpec) DeepCopyInto(out *RuleSpec)

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

func (*RuleSpec) GetMimirRuleNamespace

func (mr *RuleSpec) GetMimirRuleNamespace(namespace string) (ruleNs *rules.RuleNamespace, err error)

GetMimirRuleNamespace converts a RuleSpec to a rwrulefmt.RuleGroup

type RuleStatus

type RuleStatus struct {
	Conditions []metav1.Condition `json:"conditions"`
}

RuleStatus is the status for a MimirRule resource

func (*RuleStatus) DeepCopy

func (in *RuleStatus) DeepCopy() *RuleStatus

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

func (*RuleStatus) DeepCopyInto

func (in *RuleStatus) DeepCopyInto(out *RuleStatus)

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