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-1244: Added flow type transformation rule in FLP configuration #517

Merged
merged 5 commits into from
Jan 25, 2024

Conversation

OlivierCazade
Copy link
Contributor

Description

Added flow type transformation rule in FLP configuration

Dependencies

Related FLP PR:
netobserv/flowlogs-pipeline#554

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
    • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
    • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
    • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
    • Standard QE validation, with pre-merge tests unless stated otherwise.
    • Regression tests only (e.g. refactoring with no user-facing change).
    • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

@openshift-ci-robot
Copy link
Collaborator

openshift-ci-robot commented Dec 12, 2023

@OlivierCazade: This pull request references NETOBSERV-1244 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.16.0" version, but no target version was set.

In response to this:

Description

Added flow type transformation rule in FLP configuration

Dependencies

Related FLP PR:
netobserv/flowlogs-pipeline#554

Checklist

If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.

  • Is this PR backed with a JIRA ticket? If so, make sure it is written as a title prefix (in general, PRs affecting the NetObserv/Network Observability product should be backed with a JIRA ticket - especially if they bring user facing changes).
  • Does this PR require product documentation?
  • If so, make sure the JIRA epic is labelled with "documentation" and provides a description relevant for doc writers, such as use cases or scenarios. Any required step to activate or configure the feature should be documented there, such as new CRD knobs.
  • Does this PR require a product release notes entry?
  • If so, fill in "Release Note Text" in the JIRA.
  • Is there anything else the QE team should know before testing? E.g: configuration changes, environment setup, etc.
  • If so, make sure it is described in the JIRA ticket.
  • QE requirements (check 1 from the list):
  • Standard QE validation, with pre-merge tests unless stated otherwise.
  • Regression tests only (e.g. refactoring with no user-facing change).
  • No QE (e.g. trivial change with high reviewer's confidence, or per agreement with the QE team).

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@@ -72,6 +72,9 @@ func (b *PipelineBuilder) AddProcessorStages() error {
Type: api.AddKubernetesRuleType,
}, {
Type: api.ReinterpretDirectionRuleType,
}, {
Type: "add_kubernetes_infra",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO once FLP PR is merged: update FLP dependency and change this string using FLP API

@OlivierCazade
Copy link
Contributor Author

/hold
We need to merge FLP PR first and then update this one

Copy link

codecov bot commented Dec 12, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (9d50e16) 57.83% compared to head (4830779) 57.65%.
Report is 4 commits behind head on main.

Files Patch % Lines
controllers/flp/flp_pipeline_builder.go 94.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #517      +/-   ##
==========================================
- Coverage   57.83%   57.65%   -0.18%     
==========================================
  Files          70       70              
  Lines        9446     9458      +12     
==========================================
- Hits         5463     5453      -10     
- Misses       3653     3668      +15     
- Partials      330      337       +7     
Flag Coverage Δ
unittests 57.65% <97.05%> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -664,7 +664,7 @@ type FlowCollectorConsolePlugin struct {
// `portNaming` defines the configuration of the port-to-service name translation
PortNaming ConsolePluginPortConfig `json:"portNaming,omitempty"`

//+kubebuilder:default:={{name:"Applications",filter:{"src_namespace!":"openshift-,netobserv","dst_namespace!":"openshift-,netobserv"},default:true},{name:"Infrastructure",filter:{"src_namespace":"openshift-,netobserv","dst_namespace":"openshift-,netobserv"}},{name:"Pods network",filter:{"src_kind":"Pod","dst_kind":"Pod"},default:true},{name:"Services network",filter:{"dst_kind":"Service"}}}
//+kubebuilder:default:={{name:"Applications",filter:{"flow_type":"app"},default:true},{name:"Infrastructure",filter:{"flow_type":"infra"}},{name:"Pods network",filter:{"src_kind":"Pod","dst_kind":"Pod"},default:true},{name:"Services network",filter:{"dst_kind":"Service"}}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 love it ! It will simplify the display a lot !

@@ -703,6 +709,11 @@ filters:
component: autocomplete
placeholder: 'E.g: Ingress, Egress, Inner'
hint: Specify the direction of the Flow observed at the Node observation point.
- id: flow_type
name: Flow type
component: autocomplete
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To use autocomplete component you will need to implement getOptions on plugin side:
https://github.com/netobserv/network-observability-console-plugin/blob/be4ea4532962056f32080cd29bc99ce1fe77ca89/web/src/utils/filter-definitions.ts#L253-L297

We could even improve that to something more generic for Namespaces, Names, Kinds and this new FlowType since all of these rely on autoCompleteCache.

That would require a new route, sending field name as argument and refactor resources.go accordingly. WDYT ?

Copy link
Contributor Author

@OlivierCazade OlivierCazade Jan 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed to text. I think this is enough since the placeholder already hint the user that this is only infra or app.

And I agree that as a follow up to the generic column, we could have a task to auto complete for generic column.

@Amoghrd
Copy link
Contributor

Amoghrd commented Dec 14, 2023

/ok-to-test

@openshift-ci openshift-ci bot added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Dec 14, 2023
Copy link

New images:

  • quay.io/netobserv/network-observability-operator:36aae92
  • quay.io/netobserv/network-observability-operator-bundle:v0.0.0-36aae92
  • quay.io/netobserv/network-observability-operator-catalog:v0.0.0-36aae92

They will expire after two weeks.

To deploy this build:

# Direct deployment, from operator repo
IMAGE=quay.io/netobserv/network-observability-operator:36aae92 make deploy

# Or using operator-sdk
operator-sdk run bundle quay.io/netobserv/network-observability-operator-bundle:v0.0.0-36aae92

Or as a Catalog Source:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: netobserv-dev
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  image: quay.io/netobserv/network-observability-operator-catalog:v0.0.0-36aae92
  displayName: NetObserv development catalog
  publisher: Me
  updateStrategy:
    registryPoll:
      interval: 1m

@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jan 15, 2024
@OlivierCazade
Copy link
Contributor Author

Updated operator to use this PR:
netobserv/flowlogs-pipeline#554

Until it is merged, to build this branch it is required to use go replace to point at the FLP branch.

Copy link
Contributor

@jpinsonneau jpinsonneau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me, thanks @OlivierCazade !

@openshift-ci openshift-ci bot added the lgtm label Jan 23, 2024
@jotak jotak added the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jan 24, 2024
Copy link

New images:

  • quay.io/netobserv/network-observability-operator:ed7e2e5
  • quay.io/netobserv/network-observability-operator-bundle:v0.0.0-ed7e2e5
  • quay.io/netobserv/network-observability-operator-catalog:v0.0.0-ed7e2e5

They will expire after two weeks.

To deploy this build:

# Direct deployment, from operator repo
IMAGE=quay.io/netobserv/network-observability-operator:ed7e2e5 make deploy

# Or using operator-sdk
operator-sdk run bundle quay.io/netobserv/network-observability-operator-bundle:v0.0.0-ed7e2e5

Or as a Catalog Source:

apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: netobserv-dev
  namespace: openshift-marketplace
spec:
  sourceType: grpc
  image: quay.io/netobserv/network-observability-operator-catalog:v0.0.0-ed7e2e5
  displayName: NetObserv development catalog
  publisher: Me
  updateStrategy:
    registryPoll:
      interval: 1m

@jotak
Copy link
Member

jotak commented Jan 24, 2024

I'm also glad to see these awful infra/app filters looking so much better now :-)

One thing that is not a blocker but I think I can do that quickly as a follow-up, if you all agree, is to find another name than "flow type" ... there's so many ways to interpret "type", it's too overloaded and could mean totally different things in different context. I think "layer" is quite common to refer to things like infrastructure / applications, wdyt?

@openshift-ci openshift-ci bot removed the lgtm label Jan 24, 2024
@github-actions github-actions bot removed the ok-to-test To set manually when a PR is safe to test. Triggers image build on PR. label Jan 24, 2024
@openshift-ci openshift-ci bot added the lgtm label Jan 25, 2024
@jpinsonneau
Copy link
Contributor

jpinsonneau commented Jan 25, 2024

Changes looks good, flow layer will be better naming indeed 😺

@jotak
Copy link
Member

jotak commented Jan 25, 2024

Thinking about the upgrade process, users will still have their old quick filters. We might have to add in the release note that they could do the change manually in their config (although the old filters will continue to work)

@OlivierCazade
Copy link
Contributor Author

As discussed in scrum today, this will be tested post merge.

@OlivierCazade OlivierCazade added the no-qe This PR doesn't necessitate QE approval label Jan 25, 2024
@OlivierCazade
Copy link
Contributor Author

/approve

Copy link

openshift-ci bot commented Jan 25, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: OlivierCazade

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 08af617 into netobserv:main Jan 25, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved jira/valid-reference lgtm no-qe This PR doesn't necessitate QE approval
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants