Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions apis/flowcollector/v1beta1/flowcollector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -639,9 +639,12 @@ type FlowCollectorFLP struct {
// `deduper` allows to sample or drop flows identified as duplicates, in order to save on resource usage.
Deduper *FLPDeduper `json:"deduper,omitempty"`

// `filters` let you define custom filters to limit the amount of generated flows.
// +optional
Filters []FLPFilterSet `json:"filters"`
// `filters` lets you define custom filters to limit the amount of generated flows.
// These filters provide more flexibility than the eBPF Agent filters (in `spec.agent.ebpf.flowFilter`), such as allowing to filter by Kubernetes namespace,
// but with a lesser improvement in performance.
// [Unsupported (*)].
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can remove the Unsupported references since its going GA in 1.9

Filters FLPFilters `json:"filters"`

// `debug` allows setting some aspects of the internal configuration of the flow processor.
// This section is aimed exclusively for debugging and fine-grained performance optimizations,
Expand Down Expand Up @@ -690,16 +693,23 @@ const (
FLPFilterTargetExporters FLPFilterTarget = "Exporters"
)

// `FLPFilterSet` defines the desired configuration for FLP-based filtering satisfying all conditions
type FLPFilterSet struct {
// `filters` is a list of matches that must be all satisfied in order to remove a flow.
// `FLPFilters` defines the desired configuration for FLP-based filtering. Flows that match those filters are kept, all other flows are discarded.
type FLPFilters struct {
// `anyOf` contains a list of rules evaluated individually: any satisfied rule results in a match.
// +optional
AllOf []FLPSingleFilter `json:"allOf"`
AnyOf []FLPFilterAnyOf `json:"anyOf"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn´t this a breaking change ?
In 1.8.0 we have a Allof directly inside the Filter field.

Assuming someone already has some Filters configured, will an upgrade succeed ?


// If specified, this filters only target a single output: `Loki`, `Metrics` or `Exporters`. By default, all outputs are targeted.
// If specified, these filters only target a single output: `Loki`, `Metrics` or `Exporters`. By default, all outputs are targeted.
// +optional
// +kubebuilder:validation:Enum:="";"Loki";"Metrics";"Exporters"
OutputTarget FLPFilterTarget `json:"outputTarget,omitempty"`
}

// `FLPFilterAnyOf` defines the desired configuration for FLP-based filtering satisfying all conditions.
type FLPFilterAnyOf struct {
// `allOf` contains a list of rules that must all be satisfied in order to match a flow.
// +optional
AllOf []FLPSingleFilter `json:"allOf"`

// `sampling` is an optional sampling rate to apply to this filter.
//+kubebuilder:validation:Minimum=0
Expand Down
66 changes: 50 additions & 16 deletions apis/flowcollector/v1beta1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 27 additions & 11 deletions apis/flowcollector/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 14 additions & 7 deletions apis/flowcollector/v1beta2/flowcollector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -684,11 +684,11 @@ type FlowCollectorFLP struct {
Deduper *FLPDeduper `json:"deduper,omitempty"`

// +optional
// `filters` lets you define custom filters to limit the amount of generated flows.
// `filters` lets you define custom filters to limit the amount of generated flows. Flows that match those filters are kept, all other flows are discarded.
// These filters provide more flexibility than the eBPF Agent filters (in `spec.agent.ebpf.flowFilter`), such as allowing to filter by Kubernetes namespace,
// but with a lesser improvement in performance.
// [Unsupported (*)].
Filters []FLPFilterSet `json:"filters"`
Filters FLPFilters `json:"filters"`

// `advanced` allows setting some aspects of the internal configuration of the flow processor.
// This section is aimed mostly for debugging and fine-grained performance optimizations,
Expand Down Expand Up @@ -737,16 +737,23 @@ const (
FLPFilterTargetExporters FLPFilterTarget = "Exporters"
)

// `FLPFilterSet` defines the desired configuration for FLP-based filtering satisfying all conditions.
type FLPFilterSet struct {
// `filters` is a list of matches that must be all satisfied in order to remove a flow.
// `FLPFilters` defines the desired configuration for FLP-based filtering. Flows that match those filters are kept, all other flows are discarded.
type FLPFilters struct {
// `anyOf` contains a list of rules evaluated individually: any rule that is satisfied results in a match.
// +optional
AllOf []FLPSingleFilter `json:"allOf"`
AnyOf []FLPFilterAnyOf `json:"anyOf"`

// If specified, these filters only target a single output: `Loki`, `Metrics` or `Exporters`. By default, all outputs are targeted.
// +optional
// +kubebuilder:validation:Enum:="";"Loki";"Metrics";"Exporters"
OutputTarget FLPFilterTarget `json:"outputTarget,omitempty"`
}

// `FLPFilterAnyOf` is a set of rules evaluated individually.
type FLPFilterAnyOf struct {
// `allOf` contains a list of rules that must all be satisfied in order to match a flow.
// +optional
AllOf []FLPSingleFilter `json:"allOf"`

// `sampling` is an optional sampling rate to apply to this filter.
//+kubebuilder:validation:Minimum=0
Expand All @@ -756,7 +763,7 @@ type FLPFilterSet struct {

// `FLPSingleFilter` defines the desired configuration for a single FLP-based filter.
type FLPSingleFilter struct {
// Type of matching to apply.
// Type of matching to apply: `Equal` (default), `NotEqual`, `Presence`, `Absence`, `MatchRegex` or `NotMatchRegex`.
// +kubebuilder:validation:Enum:="Equal";"NotEqual";"Presence";"Absence";"MatchRegex";"NotMatchRegex"
// +kubebuilder:default:="Equal"
MatchType FLPFilterMatch `json:"matchType"`
Expand Down
38 changes: 27 additions & 11 deletions apis/flowcollector/v1beta2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading