v1alpha1

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the logging v1alpha1 API group +kubebuilder:object:generate=true +groupName=events.kubesphere.io

Index

Constants

View Source
const (
	// RuleTypeNotification represents that the rule will used to generate notifications
	// based on the original event objects.
	RuleTypeNotification = "notification"
	// RuleTypeAlert represents that the rule will be used to generate alert messages
	// that conform to the alertmanager protocol.
	RuleTypeAlert = "alert"
)
View Source
const (
	// RulerSinkTypeNotification represents event notifications sink.
	RulerSinkTypeNotification = "notification"
	// RulerSinkTypeAlert represents alert messages sink.
	RulerSinkTypeAlert = "alert"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "events.kubesphere.io", 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

func DefaultRuleScopeConfig

func DefaultRuleScopeConfig() *ruleScopeConfig

func GetRuleScopeConfig

func GetRuleScopeConfig() *ruleScopeConfig

func SetRuleScopeConfig

func SetRuleScopeConfig(c *ruleScopeConfig)

Types

type EventRule

type EventRule struct {
	// Name is simple name of rule
	Name string `json:"name,omitempty"`
	// Condition is a string similar with the where part of sql.
	// See supported grammar details on https://github.com/kubesphere/event-rule-engine#supported-grammer .
	// For example: `type="Warning" and involvedObject.kind="Pod" and reason="FailedMount"`
	Condition string `json:"condition,omitempty"`
	// Labels
	Labels map[string]string `json:"labels,omitempty"`
	// Values of Annotations can use format string with the fields of the event.
	// For example: `{"message": "%message"}`
	Annotations map[string]string `json:"annotations,omitempty"`
	// Enable is whether to enable the rule, default to `false`
	Enable bool `json:"enable,omitempty"`
	// Type represents that the rule is for notification or alert.
	// Available values are `notification` and `alert`
	Type RuleType `json:"type,omitempty"`
}

EventRule describes a notification or alert rule

func (*EventRule) DeepCopy

func (in *EventRule) DeepCopy() *EventRule

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

func (*EventRule) DeepCopyInto

func (in *EventRule) DeepCopyInto(out *EventRule)

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

type Exporter

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

	// Spec defines the specification of the desired behavior of the Exporter.
	Spec ExporterSpec `json:"spec"`

	Status ExporterStatus `json:"status,omitempty"`
}

Exporter is the Schema for the exporter API

func (*Exporter) DeepCopy

func (in *Exporter) DeepCopy() *Exporter

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

func (*Exporter) DeepCopyInto

func (in *Exporter) DeepCopyInto(out *Exporter)

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

func (*Exporter) DeepCopyObject

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

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

type ExporterList

type ExporterList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	// List of Exporters
	Items []Exporter `json:"items"`
}

ExporterList contains a list of Exporter

func (*ExporterList) DeepCopy

func (in *ExporterList) DeepCopy() *ExporterList

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

func (*ExporterList) DeepCopyInto

func (in *ExporterList) DeepCopyInto(out *ExporterList)

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

func (*ExporterList) DeepCopyObject

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

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

type ExporterSinks

type ExporterSinks struct {
	// Webhooks is a list of ExporterWebhookSink
	Webhooks []*ExporterWebhookSink `json:"webhooks,omitempty"`
	// Stdout represents whether to write events to stdout.
	// Output when configure an empty struct `{}`, but do nothing when no configuration
	Stdout *ExporterStdoutSink `json:"stdout,omitempty"`
}

ExporterSinks defines a set of sinks for Events Exporter

func (*ExporterSinks) DeepCopy

func (in *ExporterSinks) DeepCopy() *ExporterSinks

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

func (*ExporterSinks) DeepCopyInto

func (in *ExporterSinks) DeepCopyInto(out *ExporterSinks)

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

type ExporterSpec

type ExporterSpec struct {
	// Docker image of events exporter
	Image string `json:"image"`
	// Image pull policy. One of Always, Never, IfNotPresent.
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
	// If specified, the pod's scheduling constraints.
	Affinity *corev1.Affinity `json:"affinity,omitempty"`
	// Define which Nodes the Pods are scheduled on.
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	// If specified, the pod's tolerations.
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
	// Resources defines resources requests and limits for single Pod.
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`
	// List of environment variable
	Env []corev1.EnvVar `json:"env,omitempty"`
	// Volumes allows configuration of additional volumes on the output Deployment definition.
	// Volumes specified will be appended to other volumes that are generated.
	Volumes []corev1.Volume `json:"volumes,omitempty"`
	// VolumeMounts allows configuration of additional VolumeMounts on the output Deployment definition.
	// VolumeMounts specified will be appended to other VolumeMounts in the events-exporter container.
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
	// Sinks defines details of events sinks
	Sinks *ExporterSinks `json:"sinks,omitempty"`
}

ExporterSpec defines the desired state of Exporter

func (*ExporterSpec) DeepCopy

func (in *ExporterSpec) DeepCopy() *ExporterSpec

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

func (*ExporterSpec) DeepCopyInto

func (in *ExporterSpec) DeepCopyInto(out *ExporterSpec)

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

type ExporterStatus

type ExporterStatus struct {
}

ExporterStatus defines the observed state of Exporter

func (*ExporterStatus) DeepCopy

func (in *ExporterStatus) DeepCopy() *ExporterStatus

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

func (*ExporterStatus) DeepCopyInto

func (in *ExporterStatus) DeepCopyInto(out *ExporterStatus)

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

type ExporterStdoutSink

type ExporterStdoutSink struct {
}

ExporterStdoutSink defines parameters for stdout sink of Events Exporter.

func (*ExporterStdoutSink) DeepCopy

func (in *ExporterStdoutSink) DeepCopy() *ExporterStdoutSink

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

func (*ExporterStdoutSink) DeepCopyInto

func (in *ExporterStdoutSink) DeepCopyInto(out *ExporterStdoutSink)

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

type ExporterWebhookSink

type ExporterWebhookSink struct {
	// `url` gives the location of the webhook, in standard URL form (`scheme://host:port/path`).
	// Exactly one of `url` or `service` must be specified.
	Url string `json:"url,omitempty"`
	// `service` is a reference to the service for this webhook. Either
	// `service` or `url` must be specified.
	// If the webhook is running within the cluster, then you should use `service`.
	Service *ServiceReference `json:"service,omitempty"`
}

ExporterWebhookSink defines parameters for webhook sink of Events Exporter.

func (*ExporterWebhookSink) DeepCopy

func (in *ExporterWebhookSink) DeepCopy() *ExporterWebhookSink

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

func (*ExporterWebhookSink) DeepCopyInto

func (in *ExporterWebhookSink) DeepCopyInto(out *ExporterWebhookSink)

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

type Rule

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

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

Rule is the Schema for the Rule API

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.

func (*Rule) DeepCopyObject

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

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

func (*Rule) Default

func (r *Rule) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*Rule) SetupWebhookWithManager

func (r *Rule) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*Rule) ValidateCreate

func (r *Rule) ValidateCreate() error

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*Rule) ValidateDelete

func (r *Rule) ValidateDelete() error

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*Rule) ValidateUpdate

func (r *Rule) ValidateUpdate(old runtime.Object) error

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type RuleList

type RuleList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Rule `json:"items"`
}

RuleList contains a list of Rule

func (*RuleList) DeepCopy

func (in *RuleList) DeepCopy() *RuleList

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

func (*RuleList) DeepCopyInto

func (in *RuleList) DeepCopyInto(out *RuleList)

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

func (*RuleList) DeepCopyObject

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

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

type RuleSpec

type RuleSpec struct {
	Rules []EventRule `json:"rules,omitempty"`
}

RuleSpec defines the desired state of Rule

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.

type RuleStatus

type RuleStatus struct {
}

RuleStatus defines the observed state of Rule

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.

type RuleType

type RuleType string

type Ruler

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

	// Spec defines the specification of the desired behavior of the Ruler.
	Spec RulerSpec `json:"spec"`

	Status RulerStatus `json:"status,omitempty"`
}

Ruler is the Schema for the ruler API

func (*Ruler) DeepCopy

func (in *Ruler) DeepCopy() *Ruler

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

func (*Ruler) DeepCopyInto

func (in *Ruler) DeepCopyInto(out *Ruler)

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

func (*Ruler) DeepCopyObject

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

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

type RulerAlertmanagerSink

type RulerAlertmanagerSink struct {
	// `namespace` is the namespace of the alertmanager service.
	Namespace string `json:"namespace"`
	// `name` is the name of the alertmanager service.
	Name string `json:"name"`
	// `port` is the port on the alertmanager service. Default to 9093.
	// `port` should be a valid port number (1-65535, inclusive).
	Port *int `json:"port,omitempty"`
	// TargetPort is the port to access on the backend instances targeted by the alertmanager service.
	// If this is not specified, the value of the 'port' field is used.
	TargetPort *int `json:"targetPort,omitempty"`
}

RulerAlertmanagerSink is a sink to alertmanager service on k8s

func (*RulerAlertmanagerSink) DeepCopy

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

func (*RulerAlertmanagerSink) DeepCopyInto

func (in *RulerAlertmanagerSink) DeepCopyInto(out *RulerAlertmanagerSink)

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

type RulerList

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

	// List of Rulers
	Items []Ruler `json:"items"`
}

RulerList contains a list of Ruler

func (*RulerList) DeepCopy

func (in *RulerList) DeepCopy() *RulerList

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

func (*RulerList) DeepCopyInto

func (in *RulerList) DeepCopyInto(out *RulerList)

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

func (*RulerList) DeepCopyObject

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

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

type RulerSinkType

type RulerSinkType string

type RulerSinks

type RulerSinks struct {
	// Alertmanager sinks to which events alerts will be sent.
	Alertmanagers []*RulerAlertmanagerSink `json:"alertmanagers,omitempty"`
	// An alertmanager sink to which events alerts will be sent.
	// Deprecated, please use alertmanagers instead.
	Alertmanager *RulerAlertmanagerSink `json:"alertmanager,omitempty"`
	// Webhooks is a list of RulerWebhookSink to which notifications or alerts can sink
	Webhooks []*RulerWebhookSink `json:"webhooks,omitempty"`
	// Stdout can config write notifications or alerts to stdout; do nothing when no configuration
	Stdout *RulerStdoutSink `json:"stdout,omitempty"`
}

RulerSinks defines a set of sinks for Events Ruler

func (*RulerSinks) DeepCopy

func (in *RulerSinks) DeepCopy() *RulerSinks

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

func (*RulerSinks) DeepCopyInto

func (in *RulerSinks) DeepCopyInto(out *RulerSinks)

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

type RulerSpec

type RulerSpec struct {
	// Number of desired pods. Defaults to 1.
	Replicas *int32 `json:"replicas,omitempty"`
	// Docker image of events ruler
	Image string `json:"image"`
	// Image pull policy. One of Always, Never, IfNotPresent.
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
	// If specified, the pod's scheduling constraints.
	Affinity *corev1.Affinity `json:"affinity,omitempty"`
	// Define which Nodes the Pods are scheduled on.
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`
	// If specified, the pod's tolerations.
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`
	// Resources defines resources requests and limits for single Pod.
	Resources corev1.ResourceRequirements `json:"resources,omitempty"`
	// List of environment variable
	Env []corev1.EnvVar `json:"env,omitempty"`
	// Volumes allows configuration of additional volumes on the output Deployment definition.
	// Volumes specified will be appended to other volumes that are generated.
	Volumes []corev1.Volume `json:"volumes,omitempty"`
	// VolumeMounts allows configuration of additional VolumeMounts on the output Deployment definition.
	// VolumeMounts specified will be appended to other VolumeMounts in the events-ruler container.
	VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
	// Namespaces to be selected for Rules discovery.
	// If unspecified, discover Rule instances from all namespaces.
	RuleNamespaceSelector *metav1.LabelSelector `json:"ruleNamespaceSelector,omitempty"`
	// A selector to select Rules instances.
	RuleSelector *metav1.LabelSelector `json:"ruleSelector,omitempty"`
	// Sinks defines sinks detail of this ruler
	Sinks *RulerSinks `json:"sinks,omitempty"`
}

RulerSpec defines the desired state of Ruler

func (*RulerSpec) DeepCopy

func (in *RulerSpec) DeepCopy() *RulerSpec

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

func (*RulerSpec) DeepCopyInto

func (in *RulerSpec) DeepCopyInto(out *RulerSpec)

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

type RulerStatus

type RulerStatus struct {
}

RulerStatus defines the observed state of Ruler

func (*RulerStatus) DeepCopy

func (in *RulerStatus) DeepCopy() *RulerStatus

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

func (*RulerStatus) DeepCopyInto

func (in *RulerStatus) DeepCopyInto(out *RulerStatus)

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

type RulerStdoutSink

type RulerStdoutSink struct {
	// Type represents that the sink is for notification or alert.
	// Available values are `notification` and `alert`
	Type RulerSinkType `json:"type"`
}

RulerStdoutSink defines parameters for stdout sink of Events Ruler.

func (*RulerStdoutSink) DeepCopy

func (in *RulerStdoutSink) DeepCopy() *RulerStdoutSink

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

func (*RulerStdoutSink) DeepCopyInto

func (in *RulerStdoutSink) DeepCopyInto(out *RulerStdoutSink)

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

type RulerWebhookSink

type RulerWebhookSink struct {
	// Type represents that the sink is for notification or alert.
	// Available values are `notification` and `alert`
	Type RulerSinkType `json:"type"`
	// `url` gives the location of the webhook, in standard URL form (`scheme://host:port/path`).
	// Exactly one of `url` or `service` must be specified.
	Url string `json:"url,omitempty"`
	// `service` is a reference to the service for this webhook. Either
	// `service` or `url` must be specified.
	// If the webhook is running within the cluster, then you should use `service`.
	Service *ServiceReference `json:"service,omitempty"`
}

RulerWebhookSink defines parameters for webhook sink of Events Ruler.

func (*RulerWebhookSink) DeepCopy

func (in *RulerWebhookSink) DeepCopy() *RulerWebhookSink

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

func (*RulerWebhookSink) DeepCopyInto

func (in *RulerWebhookSink) DeepCopyInto(out *RulerWebhookSink)

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

type ServiceReference

type ServiceReference struct {
	// `namespace` is the namespace of the service.
	Namespace string `json:"namespace"`
	// `name` is the name of the service.
	Name string `json:"name"`
	// `port` is the port on the service and should be a valid port number (1-65535, inclusive).
	Port *int `json:"port,omitempty"`
	// `path` is an optional URL path which will be sent in any request to this service.
	Path string `json:"path,omitempty"`
}

ServiceReference holds a reference to k8s Service

func (*ServiceReference) DeepCopy

func (in *ServiceReference) DeepCopy() *ServiceReference

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

func (*ServiceReference) DeepCopyInto

func (in *ServiceReference) DeepCopyInto(out *ServiceReference)

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