v1alpha1

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright 2021.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Package v1alpha1 contains API Schema definitions for the flows v1alpha1 API group +kubebuilder:object:generate=true +groupName=flows.netobserv.io

Index

Constants

This section is empty.

Variables

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

This section is empty.

Types

type ClusterNetworkOperator

type ClusterNetworkOperator struct {

	//+kubebuilder:default:=openshift-network-operator
	// Namespace  where the configmap is going to be deployed.
	Namespace string `json:"namespace,omitempty"`
}

CNO defines the desired configuration related to the Cluster Network Configuration

func (*ClusterNetworkOperator) DeepCopy

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

func (*ClusterNetworkOperator) DeepCopyInto

func (in *ClusterNetworkOperator) DeepCopyInto(out *ClusterNetworkOperator)

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

type FlowCollector

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

	Spec   FlowCollectorSpec   `json:"spec,omitempty"`
	Status FlowCollectorStatus `json:"status,omitempty"`
}

FlowCollector is the Schema for the flowcollectors API, which pilots and configures netflow collection.

func (*FlowCollector) DeepCopy

func (in *FlowCollector) DeepCopy() *FlowCollector

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

func (*FlowCollector) DeepCopyInto

func (in *FlowCollector) DeepCopyInto(out *FlowCollector)

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

func (*FlowCollector) DeepCopyObject

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

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

type FlowCollectorConsolePlugin

type FlowCollectorConsolePlugin struct {

	//+kubebuilder:validation:Minimum=0
	//+kubebuilder:default:=1
	// Replicas defines the number of replicas (pods) to start.
	Replicas int32 `json:"replicas,omitempty"`

	//+kubebuilder:validation:Minimum=1
	//+kubebuilder:validation:Maximum=65535
	//+kubebuilder:default:=9001
	// Port is the plugin service port
	Port int32 `json:"port,omitempty"`

	//+kubebuilder:default:="quay.io/netobserv/network-observability-console-plugin:main"
	// Image is the plugin image (including domain and tag)
	Image string `json:"image,omitempty"`

	//+kubebuilder:validation:Enum=IfNotPresent;Always;Never
	//+kubebuilder:default:=IfNotPresent
	// ImagePullPolicy is the Kubernetes pull policy for the image defined above
	ImagePullPolicy string `json:"imagePullPolicy,omitempty"`

	// Compute Resources required by this container.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"`
}

FlowCollectorConsolePlugin defines the desired ConsolePlugin state of FlowCollector

func (*FlowCollectorConsolePlugin) DeepCopy

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

func (*FlowCollectorConsolePlugin) DeepCopyInto

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

type FlowCollectorGoflowKube

type FlowCollectorGoflowKube struct {

	//+kubebuilder:validation:Enum=DaemonSet;Deployment
	//+kubebuilder:default:=DaemonSet
	// Kind is the workload kind, either DaemonSet or Deployment
	Kind string `json:"kind,omitempty"`

	//+kubebuilder:validation:Minimum=0
	//+kubebuilder:default:=1
	// Replicas defines the number of replicas (pods) to start for Deployment kind. Ignored for DaemonSet.
	Replicas int32 `json:"replicas,omitempty"`

	// HPA spec of an horizontal pod autoscaler to set up for the collector Deployment. Ignored for DaemonSet.
	// +optional
	HPA *FlowCollectorHPA `json:"hpa,omitempty"`

	//+kubebuilder:validation:Minimum=1025
	//+kubebuilder:validation:Maximum=65535
	//+kubebuilder:default:=2055
	// Port is the collector port: either a service port for Deployment kind, or host port for DaemonSet kind
	// By conventions, some value are not authorized port must not be below 1024 and must not equal this values:
	// 4789,6081,500, and 4500
	Port int32 `json:"port,omitempty"`

	//+kubebuilder:validation:Minimum=1
	//+kubebuilder:validation:Maximum=65535
	//+kubebuilder:default:=8080
	// HealthPort is a collector HTTP port in the Pod that exposes the health check API
	HealthPort int32 `json:"healthPort,omitempty"`

	//+kubebuilder:default:="quay.io/netobserv/goflow2-kube:main"
	// Image is the collector image (including domain and tag)
	Image string `json:"image,omitempty"`

	//+kubebuilder:validation:Enum=IfNotPresent;Always;Never
	//+kubebuilder:default:=IfNotPresent
	// ImagePullPolicy is the Kubernetes pull policy for the image defined above
	ImagePullPolicy string `json:"imagePullPolicy,omitempty"`

	//+kubebuilder:validation:Enum=trace;debug;info;warn;error;fatal;panic
	//+kubebuilder:default:=info
	// LogLevel defines the log level for the collector runtime
	LogLevel string `json:"logLevel,omitempty"`

	// Compute Resources required by this container.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
	// +optional
	Resources corev1.ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,8,opt,name=resources"`

	//+kubebuilder:default:=false
	// PrintOutput is a debug flag to print flows exported in kube-enricher logs
	PrintOutput bool `json:"printOutput,omitempty"`
}

FlowCollectorGoflowKube defines the desired goflow-kube state of FlowCollector

func (*FlowCollectorGoflowKube) DeepCopy

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

func (*FlowCollectorGoflowKube) DeepCopyInto

func (in *FlowCollectorGoflowKube) DeepCopyInto(out *FlowCollectorGoflowKube)

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

type FlowCollectorHPA

type FlowCollectorHPA struct {
	// minReplicas is the lower limit for the number of replicas to which the autoscaler
	// can scale down.  It defaults to 1 pod.  minReplicas is allowed to be 0 if the
	// alpha feature gate HPAScaleToZero is enabled and at least one Object or External
	// metric is configured.  Scaling is active as long as at least one metric value is
	// available.
	// +optional
	MinReplicas *int32 `json:"minReplicas,omitempty" protobuf:"varint,2,opt,name=minReplicas"`
	// upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.
	MaxReplicas int32 `json:"maxReplicas" protobuf:"varint,3,opt,name=maxReplicas"`
	// target average CPU utilization (represented as a percentage of requested CPU) over all the pods;
	// if not specified the default autoscaling policy will be used.
	// +optional
	TargetCPUUtilizationPercentage *int32 `json:"targetCPUUtilizationPercentage,omitempty" protobuf:"varint,4,opt,name=targetCPUUtilizationPercentage"`
}

func (*FlowCollectorHPA) DeepCopy

func (in *FlowCollectorHPA) DeepCopy() *FlowCollectorHPA

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

func (*FlowCollectorHPA) DeepCopyInto

func (in *FlowCollectorHPA) DeepCopyInto(out *FlowCollectorHPA)

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

type FlowCollectorIPFIX

type FlowCollectorIPFIX struct {

	//+kubebuilder:validation:Pattern:=^\d+(ns|ms|s|m)?$
	//+kubebuilder:default:="10s"
	// CacheActiveTimeout is the max period during which the reporter will aggregate flows before sending
	CacheActiveTimeout string `json:"cacheActiveTimeout,omitempty" mapstructure:"cacheActiveTimeout,omitempty"`

	//+kubebuilder:validation:Minimum=0
	//+kubebuilder:default:=100
	// CacheMaxFlows is the max number of flows in an aggregate; when reached, the reporter sends the flows
	CacheMaxFlows int32 `json:"cacheMaxFlows,omitempty" mapstructure:"cacheMaxFlows,omitempty"`

	//+kubebuilder:validation:Minimum=0
	//+kubebuilder:default:=400
	// Sampling is the sampling rate on the reporter. 100 means one flow on 100 is sent. 0 means disabled.
	Sampling int32 `json:"sampling,omitempty" mapstructure:"sampling,omitempty"`
}

FlowCollectorIPFIX defines the desired IPFIX state of FlowCollector

func (*FlowCollectorIPFIX) DeepCopy

func (in *FlowCollectorIPFIX) DeepCopy() *FlowCollectorIPFIX

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

func (*FlowCollectorIPFIX) DeepCopyInto

func (in *FlowCollectorIPFIX) DeepCopyInto(out *FlowCollectorIPFIX)

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

type FlowCollectorList

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

FlowCollectorList contains a list of FlowCollector

func (*FlowCollectorList) DeepCopy

func (in *FlowCollectorList) DeepCopy() *FlowCollectorList

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

func (*FlowCollectorList) DeepCopyInto

func (in *FlowCollectorList) DeepCopyInto(out *FlowCollectorList)

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

func (*FlowCollectorList) DeepCopyObject

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

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

type FlowCollectorLoki

type FlowCollectorLoki struct {
	//+kubebuilder:default:="http://loki:3100/"
	// URL is the address of an existing Loki service to push the flows to.
	URL string `json:"url,omitempty"`

	//+kubebuilder:validation:optional
	// QuerierURL specifies the address of the Loki querier service, in case it is different from the
	// Loki ingester URL. If empty, the URL value will be used (assuming that the Loki ingester
	// and querier are int he same host).
	QuerierURL string `json:"querierUrl,omitempty"`

	//+kubebuilder:default:="1s"
	// BatchWait is max time to wait before sending a batch
	BatchWait metav1.Duration `json:"batchWait,omitempty"`

	//+kubebuilder:validation:Minimum=1
	//+kubebuilder:default:=102400
	// BatchSize is max batch size (in bytes) of logs to accumulate before sending
	BatchSize int64 `json:"batchSize,omitempty"`

	//+kubebuilder:default:="10s"
	// Timeout is the maximum time connection / request limit
	// A Timeout of zero means no timeout.
	Timeout metav1.Duration `json:"timeout,omitempty"`

	//+kubebuilder:default:="1s"
	// MinBackoff is the initial backoff time for client connection between retries
	MinBackoff metav1.Duration `json:"minBackoff,omitempty"`

	//+kubebuilder:default:="300s"
	// MaxBackoff is the maximum backoff time for client connection between retries
	MaxBackoff metav1.Duration `json:"maxBackoff,omitempty"`

	//+kubebuilder:validation:Minimum=0
	//+kubebuilder:default:=10
	// MaxRetries is the maximum number of retries for client connections
	MaxRetries int32 `json:"maxRetries,omitempty"`

	//+kubebuilder:default:={"app":"netobserv-flowcollector"}
	// StaticLabels is a map of common labels to set on each flow
	StaticLabels map[string]string `json:"staticLabels,omitempty"`

	//+kubebuilder:default:="TimeFlowEnd"
	// TimestampLabel is the label to use for time indexing in Loki. E.g. "TimeReceived", "TimeFlowStart", "TimeFlowEnd".
	TimestampLabel string `json:"timestampLabel,omitempty"`
}

FlowCollectorLoki defines the desired state for FlowCollector's Loki client

func (*FlowCollectorLoki) DeepCopy

func (in *FlowCollectorLoki) DeepCopy() *FlowCollectorLoki

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

func (*FlowCollectorLoki) DeepCopyInto

func (in *FlowCollectorLoki) DeepCopyInto(out *FlowCollectorLoki)

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

type FlowCollectorSpec

type FlowCollectorSpec struct {

	//+kubebuilder:default:=""
	// Namespace where console plugin and goflowkube pods are going to be deployed.
	// If empty, the namespace of the operator is going to be used
	Namespace string `json:"namespace,omitempty"`

	// IPFIX contains IPFIX-related settings for the flow reporter
	IPFIX FlowCollectorIPFIX `json:"ipfix,omitempty"`

	// GoflowKube contains settings related to goflow-kube
	GoflowKube FlowCollectorGoflowKube `json:"goflowkube,omitempty"`

	// Loki contains settings related to the loki client
	Loki FlowCollectorLoki `json:"loki,omitempty"`

	// ConsolePlugin contains settings related to the console dynamic plugin
	ConsolePlugin FlowCollectorConsolePlugin `json:"consolePlugin,omitempty"`

	// CNO contains settings related to the cluster network operator
	CNO ClusterNetworkOperator `json:"cno,omitempty"`
}

FlowCollectorSpec defines the desired state of FlowCollector

func (*FlowCollectorSpec) DeepCopy

func (in *FlowCollectorSpec) DeepCopy() *FlowCollectorSpec

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

func (*FlowCollectorSpec) DeepCopyInto

func (in *FlowCollectorSpec) DeepCopyInto(out *FlowCollectorSpec)

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

type FlowCollectorStatus

type FlowCollectorStatus struct {

	// Namespace where console plugin and goflowkube have been deployed.
	Namespace string `json:"namespace,omitempty"`
}

FlowCollectorStatus defines the observed state of FlowCollector

func (*FlowCollectorStatus) DeepCopy

func (in *FlowCollectorStatus) DeepCopy() *FlowCollectorStatus

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

func (*FlowCollectorStatus) DeepCopyInto

func (in *FlowCollectorStatus) DeepCopyInto(out *FlowCollectorStatus)

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