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-1214 & NETOBSERV-1399 Cluster name & zone features #546

Merged
merged 2 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions controllers/consoleplugin/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ type ColumnConfig struct {
Filter string `yaml:"filter,omitempty" json:"filter,omitempty"`
Default bool `yaml:"default,omitempty" json:"default,omitempty"`
Width int `yaml:"width,omitempty" json:"width,omitempty"`
Feature string `yaml:"feature" json:"feature"`
}

type FilterConfig struct {
Expand Down
27 changes: 23 additions & 4 deletions controllers/consoleplugin/config/static-frontend-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ columns:
filter: id
default: true
width: 15
- id: ClusterName
name: Cluster
tooltip: The cluster ID or Name.
field: K8S_ClusterName
filter: cluster_name
default: false
width: 15
feature: multiCluster
- id: SrcK8S_Name
group: Source
name: Name
Expand Down Expand Up @@ -148,6 +156,7 @@ columns:
filter: src_zone
default: false
width: 15
feature: zones
- id: DstK8S_Name
group: Destination
name: Name
Expand Down Expand Up @@ -267,6 +276,7 @@ columns:
filter: dst_zone
default: false
width: 15
feature: zones
- id: K8S_Name
name: Names
calculated: getSrcOrDstValue(SrcK8S_Name,DstK8S_Name)
Expand Down Expand Up @@ -434,6 +444,7 @@ columns:
filter: dns_id
default: false
width: 5
feature: dnsTracking
- id: DNSLatency
group: DNS
name: DNS Latency
Expand All @@ -442,6 +453,7 @@ columns:
filter: dns_latency
default: true
width: 5
feature: dnsTracking
- id: DNSResponseCode
group: DNS
name: DNS Response Code
Expand All @@ -450,6 +462,7 @@ columns:
filter: dns_flag_response_code
default: true
width: 5
feature: dnsTracking
- id: DNSErrNo
group: DNS
name: DNS Error
Expand All @@ -458,14 +471,20 @@ columns:
filter: dns_errno
default: false
width: 5
feature: dnsTracking
- id: TimeFlowRttMs
name: Flow RTT
tooltip: TCP handshake Round Trip Time
field: TimeFlowRttNs
filter: time_flow_rtt
default: true
width: 5
feature: flowRTT
filters:
- id: cluster_name
name: Cluster
component: autocomplete
hint: Specify a cluster ID or name.
- id: src_namespace
name: Namespace
component: autocomplete
Expand Down Expand Up @@ -571,13 +590,13 @@ filters:
- Ending text like "*-registry"
- Pattern like "cluster-*-registry", "c*-*-r*y", -i*e-
- id: src_zone
name: Zone Name
component: text
name: Zone
component: autocomplete
category: source
hint: Specify a single zone.
- id: dst_zone
name: Zone Name
component: text
name: Zone
component: autocomplete
category: destination
hint: Specify a single zone.
- id: src_resource
Expand Down
6 changes: 6 additions & 0 deletions controllers/consoleplugin/consoleplugin_objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,12 @@ func (b *builder) setFrontendConfig(fconf *config.FrontendConfig) error {
Mark: dedupJustMark,
Merge: dedupMerge,
}
if helper.IsMultiClusterEnabled(&b.desired.Processor) {
fconf.Features = append(fconf.Features, "multiCluster")
}
if helper.IsZoneEnabled(&b.desired.Processor) {
fconf.Features = append(fconf.Features, "zones")
}
return nil
}

Expand Down
1 change: 1 addition & 0 deletions controllers/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ const (
var LokiIndexFields = []string{"SrcK8S_Namespace", "SrcK8S_OwnerName", "SrcK8S_Type", "DstK8S_Namespace", "DstK8S_OwnerName", "DstK8S_Type"}
var LokiConnectionIndexFields = []string{"_RecordType"}
var LokiDeduperMarkIndexFields = []string{"FlowDirection", "Duplicate"}
var LokiZoneIndexFields = []string{"SrcK8S_Zone", "DstK8S_Zone"}
var FlowCollectorName = types.NamespacedName{Name: "cluster"}
var EnvNoHTTP2 = corev1.EnvVar{
Name: "GODEBUG",
Expand Down
4 changes: 4 additions & 0 deletions pkg/loki/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ func GetLokiLabels(desired *flowslatest.FlowCollectorSpec) []string {
indexFields = append(indexFields, constants.ClusterNameLabelName)
}

if helper.IsZoneEnabled(&desired.Processor) {
indexFields = append(indexFields, constants.LokiZoneIndexFields...)
}

if helper.UseEBPF(desired) {
dedupJustMark, _ := strconv.ParseBool(ebpf.DedupeJustMarkDefault)
if desired.Agent.EBPF.Advanced != nil {
Expand Down
Loading