-
Notifications
You must be signed in to change notification settings - Fork 25
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-1500: Update after refactoring of FLP transform network API #562
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,8 @@ func newPipelineBuilder( | |
} | ||
} | ||
|
||
const openshiftNamespacesPrefixes = "openshift" | ||
|
||
func (b *PipelineBuilder) AddProcessorStages() error { | ||
lastStage := *b.PipelineBuilderStage | ||
lastStage = b.addTransformFilter(lastStage) | ||
|
@@ -58,17 +60,17 @@ func (b *PipelineBuilder) AddProcessorStages() error { | |
// enrich stage (transform) configuration | ||
enrichedStage := lastStage.TransformNetwork("enrich", api.TransformNetwork{ | ||
Rules: api.NetworkTransformRules{{ | ||
Input: "SrcAddr", | ||
Output: "SrcK8S", | ||
Type: api.AddKubernetesRuleType, | ||
Type: api.AddKubernetesRuleType, | ||
Kubernetes: &api.K8sRule{ | ||
Input: "SrcAddr", | ||
Output: "SrcK8S", | ||
AddZone: addZone, | ||
}, | ||
}, { | ||
Input: "DstAddr", | ||
Output: "DstK8S", | ||
Type: api.AddKubernetesRuleType, | ||
Type: api.AddKubernetesRuleType, | ||
Kubernetes: &api.K8sRule{ | ||
Input: "DstAddr", | ||
Output: "DstK8S", | ||
AddZone: addZone, | ||
}, | ||
}, { | ||
|
@@ -80,8 +82,18 @@ func (b *PipelineBuilder) AddProcessorStages() error { | |
"SrcAddr", | ||
"DstAddr", | ||
}, | ||
Output: "K8S_FlowLayer", | ||
InfraPrefix: b.desired.Namespace, | ||
Output: "K8S_FlowLayer", | ||
InfraPrefixes: []string{b.desired.Namespace, openshiftNamespacesPrefixes}, | ||
InfraRefs: []api.K8sReference{ | ||
{ | ||
Name: "kubernetes", | ||
Namespace: "default", | ||
}, | ||
{ | ||
Name: "openshift", | ||
Namespace: "default", | ||
}, | ||
Comment on lines
+92
to
+95
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what's this exactly, do you know? I've never seen it used / never appears in my flows There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two services are deployed in the default namespace, Now, I don't exactly know what is exactly exposed in the openshift API. |
||
}, | ||
}, | ||
}}, | ||
DirectionInfo: api.NetworkTransformDirectionInfo{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,12 @@ go 1.20 | |
require ( | ||
github.com/go-logr/logr v1.4.1 | ||
github.com/mitchellh/mapstructure v1.5.0 | ||
github.com/netobserv/flowlogs-pipeline v0.1.12-0.20240226142828-26a20d207978 | ||
github.com/netobserv/flowlogs-pipeline v0.1.12-0.20240305083238-24bf8cec8807 | ||
github.com/onsi/ginkgo/v2 v2.15.0 | ||
github.com/onsi/gomega v1.31.1 | ||
github.com/openshift/api v0.0.0-20220112145620-704957ce4980 | ||
github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.71.2 | ||
github.com/prometheus/common v0.46.0 | ||
github.com/prometheus/common v0.48.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we still have the replace directive for 0.46.0 below |
||
github.com/stretchr/testify v1.8.4 | ||
go.uber.org/zap v1.26.0 | ||
gopkg.in/yaml.v2 v2.4.0 | ||
|
@@ -44,7 +44,7 @@ require ( | |
github.com/google/go-cmp v0.6.0 // indirect | ||
github.com/google/gofuzz v1.2.0 // indirect | ||
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect | ||
github.com/google/uuid v1.5.0 // indirect | ||
github.com/google/uuid v1.6.0 // indirect | ||
github.com/imdario/mergo v0.3.15 // indirect | ||
github.com/josharian/intern v1.0.0 // indirect | ||
github.com/jpillora/backoff v1.0.0 // indirect | ||
|
@@ -56,7 +56,7 @@ require ( | |
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect | ||
github.com/pkg/errors v0.9.1 // indirect | ||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect | ||
github.com/prometheus/client_golang v1.18.0 // indirect | ||
github.com/prometheus/client_golang v1.19.0 // indirect | ||
github.com/prometheus/client_model v0.5.0 // indirect | ||
github.com/prometheus/procfs v0.12.0 // indirect | ||
github.com/sirupsen/logrus v1.9.3 // indirect | ||
|
@@ -83,4 +83,4 @@ require ( | |
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect | ||
) | ||
|
||
replace github.com/prometheus/common v0.46.0 => github.com/netobserv/prometheus-common v0.46.0-netobserv | ||
replace github.com/prometheus/common v0.48.0 => github.com/netobserv/prometheus-common v0.48.0-netobserv |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be configurable to allow non openshift deployments to identify their infra too ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps as a follow-up / or waiting to see if there's demand?
People can also play with quick filters if they want to add conditions to the app/infra filters in the gui
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could introduce new tagging possibilities, but I think this could be confusing to let a user mix non openshift deployment under the infra tag.