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

Feature: Simple NetFlow Exporter for Kindnet #152

Open
aojea opened this issue Jan 12, 2025 · 2 comments
Open

Feature: Simple NetFlow Exporter for Kindnet #152

aojea opened this issue Jan 12, 2025 · 2 comments
Labels
difficulty/medium enhancement New feature or request

Comments

@aojea
Copy link
Owner

aojea commented Jan 12, 2025

Kindnet already has the node conntrack flow information

// log connecvtions summary
klog.V(4).Infof("connection: %s\torig: src=%s:%d dst=%s:%d packets=%d bytes=%d -- reply: src=%s:%d dst=%s:%d packets=%d bytes=%d duration=%v",

We need a simple NetFlow exporter for Kindnet that can translate conntrack flow data into NetFlow records and send them to a collector.

The tasks should be something like:

  • allow users to define an ipfor a netflow collector
  • get the existing conntrack flows, and if a collector is defined, format the data and sent it to the collector
  • optimize for efficiency, avoiding impact kindnet performance
  • bonus: documentation and/or tutorial on how to use it

Refernce: https://blog.palark.com/kubernetes-services-interaction-monitoring-with-netflow/

@aojea aojea added enhancement New feature or request difficulty/medium labels Jan 12, 2025
@LiorLieberman
Copy link
Contributor

To clarify - you mean to not use ipt-netflow module, instead using the conntrack flow information, correct?

So what did you have in mind is just to allow a user to define a netflow collector url?

format the data and sent it to the collector
What formatting did you think of? Looks like a lot of the nice formatting work (enriching service names and other useful metadata) in the example you attached happens inside the collector itself

@aojea
Copy link
Owner Author

aojea commented Jan 13, 2025

yeah, we already have the necessary flow information, just bear in mind these are bidirectional flows, we can also provide metadata about the pods ips, but that can be done after.

Is just to define a collector, format the flow to the corresponding protocol and send it ... maybe we should use IPFIX instead of netflow https://www.rfc-editor.org/rfc/rfc5103.html

Dependencies are important, if we are going to vendor something just check that it brings as little as possible , a quick search give me https://github.com/zoomoid/go-ipfix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/medium enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants