Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NETOBSERV-1203: minor adjustments #545

Merged
merged 1 commit into from
Jan 30, 2024
Merged
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
7 changes: 6 additions & 1 deletion apis/flowcollector/v1beta1/flowcollector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,14 @@ type FlowCollectorFLP struct {
ClusterName string `json:"clusterName,omitempty"`

//+kubebuilder:default:=false
// Set `multiClusterDeployment` to `true` to enable multi clusters feature. This will add clusterName label to flows data
// Set `multiClusterDeployment` to `true` to enable multi clusters feature. This adds clusterName label to flows data
MultiClusterDeployment *bool `json:"multiClusterDeployment,omitempty"`

//+optional
// `addZone` allows availability zone awareness by labelling flows with their source and destination zones.
// This feature requires the "topology.kubernetes.io/zone" label to be set on nodes.
AddZone *bool `json:"addZone,omitempty"`

// `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,
// such as `GOGC` and `GOMAXPROCS` env vars. Users setting its values do it at their own risk.
Expand Down
1 change: 0 additions & 1 deletion apis/flowcollector/v1beta1/flowcollector_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ func (r *FlowCollector) ConvertTo(dstRaw conversion.Hub) error {
dst.Spec.Loki.Monolithic = restored.Spec.Loki.Monolithic
dst.Spec.Loki.Microservices = restored.Spec.Loki.Microservices
dst.Spec.Loki.Manual = restored.Spec.Loki.Manual
dst.Spec.Processor.AddZone = restored.Spec.Processor.AddZone

return nil
}
Expand Down
3 changes: 2 additions & 1 deletion apis/flowcollector/v1beta1/zz_generated.conversion.go

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

5 changes: 5 additions & 0 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.

8 changes: 4 additions & 4 deletions apis/flowcollector/v1beta2/flowcollector_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ type FLPMetrics struct {

// `includeList` is a list of metric names to specify which ones to generate.
// The names correspond to the names in Prometheus without the prefix. For example,
// `namespace_egress_packets_total` will show up as `netobserv_namespace_egress_packets_total` in Prometheus.
// `namespace_egress_packets_total` shows up as `netobserv_namespace_egress_packets_total` in Prometheus.
// Note that the more metrics you add, the bigger is the impact on Prometheus workload resources.
// Metrics enabled by default are:
// `namespace_flows_total`, `node_ingress_bytes_total`, `workload_ingress_bytes_total`, `namespace_drop_packets_total` (when `PacketDrop` feature is enabled),
Expand Down Expand Up @@ -442,12 +442,12 @@ type FlowCollectorFLP struct {
ClusterName string `json:"clusterName,omitempty"`

//+kubebuilder:default:=false
// Set `multiClusterDeployment` to `true` to enable multi clusters feature. This will add clusterName label to flows data
// Set `multiClusterDeployment` to `true` to enable multi clusters feature. This adds `clusterName` label to flows data
MultiClusterDeployment *bool `json:"multiClusterDeployment,omitempty"`

//+kubebuilder:default:=false
//+optional
// `addZone` when set to `true`, the source and destination of flow will their zone added to the flow
// `addZone` allows availability zone awareness by labelling flows with their source and destination zones.
// This feature requires the "topology.kubernetes.io/zone" label to be set on nodes.
AddZone *bool `json:"addZone,omitempty"`

// `advanced` allows setting some aspects of the internal configuration of the flow processor.
Expand Down
21 changes: 14 additions & 7 deletions bundle/manifests/flows.netobserv.io_flowcollectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4135,6 +4135,12 @@ spec:
and forwards them to the Loki persistence layer and/or any available
exporter.'
properties:
addZone:
description: '`addZone` allows availability zone awareness by
labelling flows with their source and destination zones. This
feature requires the "topology.kubernetes.io/zone" label to
be set on nodes.'
type: boolean
clusterName:
default: ""
description: '`clusterName` is the name of the cluster to appear
Expand Down Expand Up @@ -4974,7 +4980,7 @@ spec:
multiClusterDeployment:
default: false
description: Set `multiClusterDeployment` to `true` to enable
multi clusters feature. This will add clusterName label to flows
multi clusters feature. This adds clusterName label to flows
data
type: boolean
port:
Expand Down Expand Up @@ -7103,9 +7109,10 @@ spec:
exporter.'
properties:
addZone:
default: false
description: '`addZone` when set to `true`, the source and destination
of flow will their zone added to the flow'
description: '`addZone` allows availability zone awareness by
labelling flows with their source and destination zones. This
feature requires the "topology.kubernetes.io/zone" label to
be set on nodes.'
type: boolean
advanced:
description: '`advanced` allows setting some aspects of the internal
Expand Down Expand Up @@ -7797,8 +7804,8 @@ spec:
description: '`includeList` is a list of metric names to specify
which ones to generate. The names correspond to the names
in Prometheus without the prefix. For example, `namespace_egress_packets_total`
will show up as `netobserv_namespace_egress_packets_total`
in Prometheus. Note that the more metrics you add, the bigger
shows up as `netobserv_namespace_egress_packets_total` in
Prometheus. Note that the more metrics you add, the bigger
is the impact on Prometheus workload resources. Metrics
enabled by default are: `namespace_flows_total`, `node_ingress_bytes_total`,
`workload_ingress_bytes_total`, `namespace_drop_packets_total`
Expand Down Expand Up @@ -7942,7 +7949,7 @@ spec:
multiClusterDeployment:
default: false
description: Set `multiClusterDeployment` to `true` to enable
multi clusters feature. This will add clusterName label to flows
multi clusters feature. This adds `clusterName` label to flows
data
type: boolean
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,10 @@ spec:
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:fieldDependency:processor.multiClusterDeployment:true
- displayName: Availability zones
path: processor.addZone
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- path: processor.advanced
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
Expand Down Expand Up @@ -740,8 +744,6 @@ spec:
path: loki.readTimeout
- displayName: Namespace
path: namespace
- displayName: Add zone
path: processor.addZone
- displayName: Log types
path: processor.logTypes
- displayName: Disable alerts
Expand Down
21 changes: 14 additions & 7 deletions config/crd/bases/flows.netobserv.io_flowcollectors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4121,6 +4121,12 @@ spec:
and forwards them to the Loki persistence layer and/or any available
exporter.'
properties:
addZone:
description: '`addZone` allows availability zone awareness by
labelling flows with their source and destination zones. This
feature requires the "topology.kubernetes.io/zone" label to
be set on nodes.'
type: boolean
clusterName:
default: ""
description: '`clusterName` is the name of the cluster to appear
Expand Down Expand Up @@ -4960,7 +4966,7 @@ spec:
multiClusterDeployment:
default: false
description: Set `multiClusterDeployment` to `true` to enable
multi clusters feature. This will add clusterName label to flows
multi clusters feature. This adds clusterName label to flows
data
type: boolean
port:
Expand Down Expand Up @@ -7089,9 +7095,10 @@ spec:
exporter.'
properties:
addZone:
default: false
description: '`addZone` when set to `true`, the source and destination
of flow will their zone added to the flow'
description: '`addZone` allows availability zone awareness by
labelling flows with their source and destination zones. This
feature requires the "topology.kubernetes.io/zone" label to
be set on nodes.'
type: boolean
advanced:
description: '`advanced` allows setting some aspects of the internal
Expand Down Expand Up @@ -7783,8 +7790,8 @@ spec:
description: '`includeList` is a list of metric names to specify
which ones to generate. The names correspond to the names
in Prometheus without the prefix. For example, `namespace_egress_packets_total`
will show up as `netobserv_namespace_egress_packets_total`
in Prometheus. Note that the more metrics you add, the bigger
shows up as `netobserv_namespace_egress_packets_total` in
Prometheus. Note that the more metrics you add, the bigger
is the impact on Prometheus workload resources. Metrics
enabled by default are: `namespace_flows_total`, `node_ingress_bytes_total`,
`workload_ingress_bytes_total`, `namespace_drop_packets_total`
Expand Down Expand Up @@ -7928,7 +7935,7 @@ spec:
multiClusterDeployment:
default: false
description: Set `multiClusterDeployment` to `true` to enable
multi clusters feature. This will add clusterName label to flows
multi clusters feature. This adds `clusterName` label to flows
data
type: boolean
resources:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ spec:
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:advanced
- urn:alm:descriptor:com.tectonic.ui:fieldDependency:processor.multiClusterDeployment:true
- displayName: Availability zones
path: processor.addZone
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:booleanSwitch
- path: processor.advanced
x-descriptors:
- urn:alm:descriptor:com.tectonic.ui:hidden
Expand Down
2 changes: 1 addition & 1 deletion controllers/ebpf/agent_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func (c *AgentController) desired(ctx context.Context, coll *flowslatest.FlowCol
volumeMounts = append(volumeMounts, volumeMount)
}

if helper.IsFeatureEnabled(&coll.Spec.Agent.EBPF, flowslatest.PacketDrop) {
if helper.IsAgentFeatureEnabled(&coll.Spec.Agent.EBPF, flowslatest.PacketDrop) {
if !coll.Spec.Agent.EBPF.Privileged {
rlog.Error(fmt.Errorf("invalid configuration"), "To use PacketsDrop feature privileged mode needs to be enabled")
} else {
Expand Down
7 changes: 2 additions & 5 deletions controllers/flp/flp_pipeline_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ func (b *PipelineBuilder) AddProcessorStages() error {
lastStage = b.addTransformFilter(lastStage)
lastStage = b.addConnectionTracking(lastStage)

addZone := false
if b.desired.Processor.AddZone != nil {
addZone = *b.desired.Processor.AddZone
}
addZone := helper.IsZoneEnabled(&b.desired.Processor)

// enrich stage (transform) configuration
enrichedStage := lastStage.TransformNetwork("enrich", api.TransformNetwork{
Expand Down Expand Up @@ -359,7 +356,7 @@ func (b *PipelineBuilder) addTransformFilter(lastStage config.PipelineBuilderSta
var clusterName string
transformFilterRules := []api.TransformFilterRule{}

if b.desired.Processor.MultiClusterDeployment != nil && *b.desired.Processor.MultiClusterDeployment {
if helper.IsMultiClusterEnabled(&b.desired.Processor) {
if b.desired.Processor.ClusterName != "" {
clusterName = b.desired.Processor.ClusterName
} else {
Expand Down
17 changes: 11 additions & 6 deletions docs/FlowCollector.md
Original file line number Diff line number Diff line change
Expand Up @@ -7401,6 +7401,13 @@ TLS client configuration for Loki URL.
</tr>
</thead>
<tbody><tr>
<td><b>addZone</b></td>
<td>boolean</td>
<td>
`addZone` allows availability zone awareness by labelling flows with their source and destination zones. This feature requires the "topology.kubernetes.io/zone" label to be set on nodes.<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>clusterName</b></td>
<td>string</td>
<td>
Expand Down Expand Up @@ -7550,7 +7557,7 @@ TLS client configuration for Loki URL.
<td><b>multiClusterDeployment</b></td>
<td>boolean</td>
<td>
Set `multiClusterDeployment` to `true` to enable multi clusters feature. This will add clusterName label to flows data<br/>
Set `multiClusterDeployment` to `true` to enable multi clusters feature. This adds clusterName label to flows data<br/>
<br/>
<i>Default</i>: false<br/>
</td>
Expand Down Expand Up @@ -12660,9 +12667,7 @@ TLS client configuration for Loki URL.
<td><b>addZone</b></td>
<td>boolean</td>
<td>
`addZone` when set to `true`, the source and destination of flow will their zone added to the flow<br/>
<br/>
<i>Default</i>: false<br/>
`addZone` allows availability zone awareness by labelling flows with their source and destination zones. This feature requires the "topology.kubernetes.io/zone" label to be set on nodes.<br/>
</td>
<td>false</td>
</tr><tr>
Expand Down Expand Up @@ -12758,7 +12763,7 @@ TLS client configuration for Loki URL.
<td><b>multiClusterDeployment</b></td>
<td>boolean</td>
<td>
Set `multiClusterDeployment` to `true` to enable multi clusters feature. This will add clusterName label to flows data<br/>
Set `multiClusterDeployment` to `true` to enable multi clusters feature. This adds `clusterName` label to flows data<br/>
<br/>
<i>Default</i>: false<br/>
</td>
Expand Down Expand Up @@ -13831,7 +13836,7 @@ target specifies the target value for the given metric
<td><b>includeList</b></td>
<td>[]enum</td>
<td>
`includeList` is a list of metric names to specify which ones to generate. The names correspond to the names in Prometheus without the prefix. For example, `namespace_egress_packets_total` will show up as `netobserv_namespace_egress_packets_total` in Prometheus. Note that the more metrics you add, the bigger is the impact on Prometheus workload resources. Metrics enabled by default are: `namespace_flows_total`, `node_ingress_bytes_total`, `workload_ingress_bytes_total`, `namespace_drop_packets_total` (when `PacketDrop` feature is enabled), `namespace_rtt_seconds` (when `FlowRTT` feature is enabled), `namespace_dns_latency_seconds` (when `DNSTracking` feature is enabled). More information, with full list of available metrics: https://github.com/netobserv/network-observability-operator/blob/main/docs/Metrics.md<br/>
`includeList` is a list of metric names to specify which ones to generate. The names correspond to the names in Prometheus without the prefix. For example, `namespace_egress_packets_total` shows up as `netobserv_namespace_egress_packets_total` in Prometheus. Note that the more metrics you add, the bigger is the impact on Prometheus workload resources. Metrics enabled by default are: `namespace_flows_total`, `node_ingress_bytes_total`, `workload_ingress_bytes_total`, `namespace_drop_packets_total` (when `PacketDrop` feature is enabled), `namespace_rtt_seconds` (when `FlowRTT` feature is enabled), `namespace_dns_latency_seconds` (when `DNSTracking` feature is enabled). More information, with full list of available metrics: https://github.com/netobserv/network-observability-operator/blob/main/docs/Metrics.md<br/>
</td>
<td>false</td>
</tr><tr>
Expand Down
Loading
Loading