Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,12 @@ rules:
- get
- list
- watch
- apiGroups:
- k8s.ovn.org
resources:
- clusteruserdefinednetworks
- userdefinednetworks
verbs:
- get
- list
- watch
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,15 @@ spec:
- get
- patch
- update
- apiGroups:
- k8s.ovn.org
resources:
- clusteruserdefinednetworks
- userdefinednetworks
verbs:
- get
- list
- watch
- apiGroups:
- loki.grafana.com
resources:
Expand Down
9 changes: 9 additions & 0 deletions config/rbac/component_roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ rules:
- get
- list
- watch
- apiGroups:
- k8s.ovn.org
resources:
- clusteruserdefinednetworks
- userdefinednetworks
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
9 changes: 9 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@ rules:
- get
- patch
- update
- apiGroups:
- k8s.ovn.org
resources:
- clusteruserdefinednetworks
- userdefinednetworks
verbs:
- get
- list
- watch
- apiGroups:
- loki.grafana.com
resources:
Expand Down
1 change: 0 additions & 1 deletion controllers/consoleplugin/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ type FieldConfig struct {
Type string `yaml:"type" json:"type"`
Description string `yaml:"description" json:"description"`
LokiLabel bool `yaml:"lokiLabel,omitempty" json:"lokiLabel,omitempty"`
Filter string `yaml:"filter,omitempty" json:"filter,omitempty"`
}

type FrontendConfig struct {
Expand Down
15 changes: 8 additions & 7 deletions controllers/consoleplugin/config/static-frontend-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,9 @@ columns:
tooltip: Network name, such as Secondary network or UDN.
field: SrcK8S_NetworkName
filter: src_network
default: false
default: true
width: 15
feature: multiNetworks
- id: DstK8S_Name
group: Destination
name: Name
Expand Down Expand Up @@ -315,8 +316,9 @@ columns:
tooltip: Network name, such as Secondary network or UDN.
field: DstK8S_NetworkName
filter: dst_network
default: false
default: true
width: 15
feature: multiNetworks
- id: K8S_Name
name: Names
calculated: '[SrcK8S_Name,DstK8S_Name]'
Expand Down Expand Up @@ -458,7 +460,7 @@ columns:
tooltip: The list of User Defined Networks.
field: Udns
filter: udns
default: true
default: false
width: 15
feature: udnMapping
- id: FlowDirInts
Expand All @@ -483,7 +485,6 @@ columns:
fields:
- Packets
- PktDropPackets
filter: pkt_drop_cause
default: true
width: 5
- id: FlowDuration
Expand Down Expand Up @@ -523,13 +524,15 @@ columns:
name: Drop State
tooltip: TCP state on last dropped packet.
field: PktDropLatestState
filter: pkt_drop_state
default: false
width: 10
feature: pktDrop
- id: PktDropLatestDropCause
name: Drop Cause
tooltip: TCP state on last dropped packet.
field: PktDropLatestDropCause
filter: pkt_drop_cause
default: false
width: 10
feature: pktDrop
Expand Down Expand Up @@ -1094,7 +1097,7 @@ scopes:
labels:
- SrcK8S_NetworkName
- DstK8S_NetworkName
feature: udnMapping
feature: multiNetworks
filters:
- src_network
- dst_network
Expand Down Expand Up @@ -1377,11 +1380,9 @@ fields:
- name: PktDropLatestState
type: string
description: TCP state on last dropped packet
filter: pkt_drop_state # couldn't guess from config
- name: PktDropLatestDropCause
type: string
description: Latest drop cause
filter: pkt_drop_cause # couldn't guess from config
- name: PktDropLatestFlags
type: number
description: TCP flags on last dropped packet
Expand Down
4 changes: 4 additions & 0 deletions controllers/consoleplugin/consoleplugin_objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,10 @@ func (b *builder) setFrontendConfig(fconf *cfg.FrontendConfig) error {
fconf.Features = append(fconf.Features, "udnMapping")
}

if helper.IsUDNMappingEnabled(&b.desired.Agent.EBPF) || helper.HasSecondaryIndexes(&b.desired.Processor) {
fconf.Features = append(fconf.Features, "multiNetworks")
}

if helper.IsIPSecEnabled(&b.desired.Agent.EBPF) {
fconf.Features = append(fconf.Features, "ipsec")
}
Expand Down
9 changes: 9 additions & 0 deletions helm/templates/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,15 @@ rules:
- get
- patch
- update
- apiGroups:
- k8s.ovn.org
resources:
- clusteruserdefinednetworks
- userdefinednetworks
verbs:
- get
- list
- watch
- apiGroups:
- loki.grafana.com
resources:
Expand Down
4 changes: 4 additions & 0 deletions pkg/helper/flowcollector.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ func IsEBPFFlowFilterEnabled(spec *flowslatest.FlowCollectorEBPF) bool {
return spec.FlowFilter != nil && spec.FlowFilter.Enable != nil && *spec.FlowFilter.Enable
}

func HasSecondaryIndexes(spec *flowslatest.FlowCollectorFLP) bool {
return spec.Advanced != nil && len(spec.Advanced.SecondaryNetworks) > 0
}

func GetEBPFMetricsPort(spec *flowslatest.FlowCollectorEBPF) int32 {
port := int32(constants.EBPFMetricPort)
if spec.Metrics.Server.Port != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import (
//+kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions,verbs=get;list;watch
//+kubebuilder:rbac:groups=apiextensions.k8s.io,resources=customresourcedefinitions/status,verbs=update;patch
//+kubebuilder:rbac:groups=autoscaling,resources=horizontalpodautoscalers,verbs=create;delete;patch;update;get;watch;list
//+kubebuilder:rbac:groups=k8s.ovn.org,resources=userdefinednetworks;clusteruserdefinednetworks,verbs=get;list;watch

type Registerer func(context.Context, *Manager) error

Expand Down