Skip to content

Commit b2b9812

Browse files
authored
NETOBSERV-1904: Fix UDN frontend config (#1050)
* Fix UDN frontend config - Remove duplicate entries - Introduce Network Name / use it instead of UDN for scopes * Increase udn column size
1 parent 1a7928a commit b2b9812

File tree

86 files changed

+3968
-363
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+3968
-363
lines changed

controllers/consoleplugin/config/static-frontend-config.yaml

Lines changed: 59 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,14 @@ columns:
169169
default: false
170170
width: 10
171171
feature: subnetLabels
172+
- id: SrcNetworkName
173+
group: Source
174+
name: Network Name
175+
tooltip: Network name, such as Secondary network or UDN.
176+
field: SrcK8S_NetworkName
177+
filter: src_network
178+
default: false
179+
width: 15
172180
- id: DstK8S_Name
173181
group: Destination
174182
name: Name
@@ -301,6 +309,14 @@ columns:
301309
default: false
302310
width: 10
303311
feature: subnetLabels
312+
- id: DstNetworkName
313+
group: Destination
314+
name: Network Name
315+
tooltip: Network name, such as Secondary network or UDN.
316+
field: DstK8S_NetworkName
317+
filter: dst_network
318+
default: false
319+
width: 15
304320
- id: K8S_Name
305321
name: Names
306322
calculated: '[SrcK8S_Name,DstK8S_Name]'
@@ -439,24 +455,18 @@ columns:
439455
width: 10
440456
- id: Udns
441457
name: UDN labels
458+
tooltip: The list of User Defined Networks.
442459
field: Udns
443460
filter: udns
444461
default: true
445-
width: 10
462+
width: 15
446463
feature: udnMapping
447464
- id: FlowDirInts
448465
name: Interfaces and Directions
449466
tooltip: Pairs of network interface and direction of the Flow observed at the network interface observation point.
450467
field: Interfaces
451468
default: false
452469
width: 15
453-
- id: UDN
454-
name: User Defined Network
455-
tooltip: The user defined network identifier.
456-
field: UdnId
457-
filter: udn
458-
default: false
459-
width: 15
460470
- id: Bytes
461471
name: Bytes
462472
tooltip: The total aggregated number of bytes.
@@ -906,6 +916,14 @@ filters:
906916
- Starting text like cluster, "cluster-*"
907917
- Ending text like "*-registry"
908918
- Pattern like "cluster-*-registry", "c*-*-r*y", -i*e-
919+
- id: src_network
920+
name: Network Name
921+
component: text
922+
category: source
923+
- id: dst_network
924+
name: Network Name
925+
component: text
926+
category: destination
909927
- id: protocol
910928
name: Protocol
911929
component: autocomplete
@@ -958,12 +976,10 @@ filters:
958976
component: autocomplete
959977
placeholder: 'E.g: Ingress, Egress'
960978
hint: Specify the direction of the Flow observed at the network interface observation point.
961-
- id: udn
979+
- id: udns
962980
name: User Defined Network
963981
component: autocomplete
964982
hint: Specify a user defined network name.
965-
- id: udns
966-
name: interface assigned udn label
967983
- id: id
968984
name: Conversation Id
969985
component: text
@@ -1051,13 +1067,17 @@ scopes:
10511067
feature: multiCluster
10521068
filter: cluster_name
10531069
stepInto: zone
1054-
- id: udn
1055-
name: UDN
1056-
shortName: UDN
1057-
description: User Defined Network
1070+
- id: network
1071+
name: Network
1072+
shortName: Net
1073+
description: Network name, such as User Defined Network
10581074
labels:
1059-
- UdnId
1060-
filter: udn
1075+
- SrcK8S_NetworkName
1076+
- DstK8S_NetworkName
1077+
feature: udnMapping
1078+
filters:
1079+
- src_network
1080+
- dst_network
10611081
stepInto: namespace
10621082
- id: zone
10631083
name: Zone
@@ -1081,12 +1101,12 @@ scopes:
10811101
- SrcK8S_HostName
10821102
- DstK8S_HostName
10831103
groups:
1084-
- udns
1104+
- networks
10851105
- zones
10861106
- clusters
10871107
- clusters+zones
1088-
- clusters+udns
1089-
- udns+zones
1108+
- clusters+networks
1109+
- networks+zones
10901110
filters:
10911111
- src_host_name
10921112
- dst_host_name
@@ -1105,9 +1125,9 @@ scopes:
11051125
- zones
11061126
- zones+hosts
11071127
- hosts
1108-
- udns
1109-
- udns+zones
1110-
- udns+hosts
1128+
- networks
1129+
- networks+zones
1130+
- networks+hosts
11111131
filters:
11121132
- src_namespace
11131133
- dst_namespace
@@ -1134,10 +1154,10 @@ scopes:
11341154
- hosts
11351155
- hosts+namespaces
11361156
- namespaces
1137-
- udns
1138-
- udns+zones
1139-
- udns+hosts
1140-
- udns+namespaces
1157+
- networks
1158+
- networks+zones
1159+
- networks+hosts
1160+
- networks+namespaces
11411161
filters:
11421162
- src_owner_name
11431163
- dst_owner_name
@@ -1177,11 +1197,11 @@ scopes:
11771197
- namespaces
11781198
- namespaces+owners
11791199
- owners
1180-
- udns
1181-
- udns+zones
1182-
- udns+hosts
1183-
- udns+namespaces
1184-
- udns+owners
1200+
- networks
1201+
- networks+zones
1202+
- networks+hosts
1203+
- networks+namespaces
1204+
- networks+owners
11851205
filters:
11861206
- src_resource
11871207
- dst_resource
@@ -1234,6 +1254,9 @@ fields:
12341254
- name: SrcSubnetLabel
12351255
type: string
12361256
description: Source subnet label
1257+
- name: SrcK8S_NetworkName
1258+
type: string
1259+
description: Source network name
12371260
- name: DstK8S_Name
12381261
type: string
12391262
description: Name of the destination Kubernetes object, such as Pod name, Service name or Node name.
@@ -1272,6 +1295,9 @@ fields:
12721295
- name: DstSubnetLabel
12731296
type: string
12741297
description: Destination subnet label
1298+
- name: DstK8S_NetworkName
1299+
type: string
1300+
description: Destination network name
12751301
- name: K8S_FlowLayer
12761302
type: string
12771303
description: "Flow layer: 'app' or 'infra'"
@@ -1311,7 +1337,7 @@ fields:
13111337
description: Network interfaces
13121338
- name: Udns
13131339
type: string[]
1314-
description: Network interfaces UDNs mapping
1340+
description: List of User Defined Networks
13151341
- name: Flags
13161342
type: string[]
13171343
description: |
@@ -1389,10 +1415,6 @@ fields:
13891415
- name: K8S_ClusterName
13901416
type: string
13911417
description: Cluster name or identifier
1392-
- name: UdnId
1393-
type: string
1394-
description: User Defined Network
1395-
lokiLabel: true
13961418
- name: _RecordType
13971419
type: string
13981420
description: "Type of record: 'flowLog' for regular flow logs, or 'newConnection', 'heartbeat', 'endConnection' for conversation tracking"

controllers/flp/flp_pipeline_builder.go

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ func (b *PipelineBuilder) AddProcessorStages() error {
7979
IPField: "SrcAddr",
8080
MACField: "SrcMac",
8181
InterfacesField: "Interfaces",
82+
UDNsField: "Udns",
8283
Output: "SrcK8S",
8384
AddZone: addZone,
8485
},
@@ -89,6 +90,7 @@ func (b *PipelineBuilder) AddProcessorStages() error {
8990
IPField: "DstAddr",
9091
MACField: "DstMac",
9192
InterfacesField: "Interfaces",
93+
UDNsField: "Udns",
9294
Output: "DstK8S",
9395
AddZone: addZone,
9496
},
@@ -161,29 +163,22 @@ func (b *PipelineBuilder) AddProcessorStages() error {
161163

162164
// Propagate 2dary networks config
163165
var secondaryNetworks []api.SecondaryNetwork
164-
hasOvnk := false
165166
if b.desired.Processor.Advanced != nil && len(b.desired.Processor.Advanced.SecondaryNetworks) > 0 {
166167
for _, sn := range b.desired.Processor.Advanced.SecondaryNetworks {
167168
flpSN := api.SecondaryNetwork{
168169
Name: sn.Name,
169170
Index: map[string]any{},
170171
}
171-
if sn.Name == ovnkSecondary {
172-
hasOvnk = true
173-
}
174172
for _, index := range sn.Index {
175173
flpSN.Index[strings.ToLower(string(index))] = nil
176174
}
177175
secondaryNetworks = append(secondaryNetworks, flpSN)
178176
}
179177
}
180-
if !hasOvnk && helper.IsUDNMappingEnabled(&b.desired.Agent.EBPF) {
178+
if helper.IsUDNMappingEnabled(&b.desired.Agent.EBPF) {
181179
secondaryNetworks = append(secondaryNetworks, api.SecondaryNetwork{
182-
Name: ovnkSecondary,
183-
Index: map[string]any{
184-
"ip": nil,
185-
"interface": nil,
186-
},
180+
Name: ovnkSecondary,
181+
Index: map[string]any{"udn": nil},
187182
})
188183
}
189184

go.mod

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ require (
7979
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
8080
github.com/google/uuid v1.6.0 // indirect
8181
github.com/gopacket/gopacket v1.2.0 // indirect
82-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.23.0 // indirect
82+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.24.0 // indirect
8383
github.com/heptiolabs/healthcheck v0.0.0-20211123025425-613501dd5deb // indirect
8484
github.com/inconshreveable/mousetrap v1.1.0 // indirect
8585
github.com/ip2location/ip2location-go/v9 v9.7.0 // indirect
@@ -131,34 +131,35 @@ require (
131131
github.com/xdg-go/scram v1.1.2 // indirect
132132
github.com/xdg-go/stringprep v1.0.4 // indirect
133133
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
134+
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
134135
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
135-
go.opentelemetry.io/otel v1.32.0 // indirect
136+
go.opentelemetry.io/otel v1.33.0 // indirect
136137
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.32.0 // indirect
137138
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.29.0 // indirect
138-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.28.0 // indirect
139-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.27.0 // indirect
139+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.33.0 // indirect
140+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.33.0 // indirect
140141
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.26.0 // indirect
141-
go.opentelemetry.io/otel/metric v1.32.0 // indirect
142-
go.opentelemetry.io/otel/sdk v1.32.0 // indirect
142+
go.opentelemetry.io/otel/metric v1.33.0 // indirect
143+
go.opentelemetry.io/otel/sdk v1.33.0 // indirect
143144
go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect
144-
go.opentelemetry.io/otel/trace v1.32.0 // indirect
145-
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
145+
go.opentelemetry.io/otel/trace v1.33.0 // indirect
146+
go.opentelemetry.io/proto/otlp v1.4.0 // indirect
146147
go.uber.org/atomic v1.9.0 // indirect
147148
go.uber.org/multierr v1.11.0 // indirect
148149
golang.org/x/crypto v0.31.0 // indirect
149150
golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect
150151
golang.org/x/net v0.33.0 // indirect
151-
golang.org/x/oauth2 v0.23.0 // indirect
152+
golang.org/x/oauth2 v0.24.0 // indirect
152153
golang.org/x/sync v0.10.0 // indirect
153154
golang.org/x/sys v0.28.0 // indirect
154155
golang.org/x/term v0.27.0 // indirect
155156
golang.org/x/text v0.21.0 // indirect
156157
golang.org/x/time v0.7.0 // indirect
157158
golang.org/x/tools v0.28.0 // indirect
158159
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
159-
google.golang.org/genproto/googleapis/api v0.0.0-20241104194629-dd2ea8efbc28 // indirect
160-
google.golang.org/genproto/googleapis/rpc v0.0.0-20241104194629-dd2ea8efbc28 // indirect
161-
google.golang.org/grpc v1.67.1 // indirect
160+
google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect
161+
google.golang.org/genproto/googleapis/rpc v0.0.0-20241209162323-e6fa225c2576 // indirect
162+
google.golang.org/grpc v1.68.1 // indirect
162163
google.golang.org/protobuf v1.36.1 // indirect
163164
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
164165
gopkg.in/gcfg.v1 v1.2.3 // indirect
@@ -177,3 +178,5 @@ require (
177178
)
178179

179180
replace github.com/prometheus/common v0.55.0 => github.com/netobserv/prometheus-common v0.55.0-netobserv
181+
182+
replace github.com/netobserv/flowlogs-pipeline => github.com/jotak/flowlogs-pipeline v0.0.0-20250123155116-d340ae3c81cb

0 commit comments

Comments
 (0)