Documentation ¶
Overview ¶
Package v1alpha1 contains API Schema definitions for the logging v1alpha1 API group +kubebuilder:object:generate=true +groupName=events.kubesphere.io
Index ¶
- Constants
- Variables
- func DefaultRuleScopeConfig() *ruleScopeConfig
- func GetRuleScopeConfig() *ruleScopeConfig
- func SetRuleScopeConfig(c *ruleScopeConfig)
- type EventRule
- type Exporter
- type ExporterList
- type ExporterSinks
- type ExporterSpec
- type ExporterStatus
- type ExporterStdoutSink
- type ExporterWebhookSink
- type Rule
- func (in *Rule) DeepCopy() *Rule
- func (in *Rule) DeepCopyInto(out *Rule)
- func (in *Rule) DeepCopyObject() runtime.Object
- func (r *Rule) Default()
- func (r *Rule) SetupWebhookWithManager(mgr ctrl.Manager) error
- func (r *Rule) ValidateCreate() error
- func (r *Rule) ValidateDelete() error
- func (r *Rule) ValidateUpdate(old runtime.Object) error
- type RuleList
- type RuleSpec
- type RuleStatus
- type RuleType
- type Ruler
- type RulerAlertmanagerSink
- type RulerList
- type RulerSinkType
- type RulerSinks
- type RulerSpec
- type RulerStatus
- type RulerStdoutSink
- type RulerWebhookSink
- type ServiceReference
Constants ¶
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" )
const ( // RulerSinkTypeNotification represents event notifications sink. RulerSinkTypeNotification = "notification" // RulerSinkTypeAlert represents alert messages sink. RulerSinkTypeAlert = "alert" )
Variables ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventRule.
func (*EventRule) DeepCopyInto ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Exporter.
func (*Exporter) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Exporter) DeepCopyObject ¶
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"` // 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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Rule.
func (*Rule) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Rule) DeepCopyObject ¶
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 (*Rule) ValidateCreate ¶
ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (*Rule) ValidateDelete ¶
ValidateDelete 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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleList.
func (*RuleList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*RuleList) DeepCopyObject ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuleSpec.
func (*RuleSpec) DeepCopyInto ¶
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 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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Ruler.
func (*Ruler) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Ruler) DeepCopyObject ¶
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 ¶
func (in *RulerAlertmanagerSink) DeepCopy() *RulerAlertmanagerSink
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RulerList.
func (*RulerList) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*RulerList) DeepCopyObject ¶
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 is an alertmanager sink to which only alerts can sink. 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"` // 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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RulerSpec.
func (*RulerSpec) DeepCopyInto ¶
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.