-
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-1110: Enable support for Flow RTT #394
Changes from 5 commits
c0ba666
7c4e6e6
239dcb4
067d1a1
e5361dd
369d3aa
63bd6ae
a720653
925fc34
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,6 +146,19 @@ type FlowCollectorIPFIX struct { | |
OVNKubernetes OVNKubernetesConfig `json:"ovnKubernetes,omitempty" mapstructure:"-"` | ||
} | ||
|
||
// Agent feature, can be one of:<br> | ||
// - `PKT_DROP`, to track packet drops.<br> | ||
// - `DNS_TRACKING`, to track specific information on DNS traffic.<br> | ||
// - `FLOW_RTT`, to track L4 latency. <i>Unsupported (*)</i><br> | ||
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. pls remove 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. @msherif1234 I guess you are talking about the HTML blocks right ? That's not new to this PR: https://issues.redhat.com/browse/NETOBSERV-1104 ; it's related to asciidocs
jotak marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// +kubebuilder:validation:Enum:="PKT_DROP";"DNS_TRACKING";"FLOW_RTT" | ||
type AgentFeature string | ||
|
||
const ( | ||
PktDrop AgentFeature = "PKT_DROP" | ||
DNSTracking AgentFeature = "DNS_TRACKING" | ||
FlowRTT AgentFeature = "FLOW_RTT" | ||
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. if I am not mistaken Strings need to use Pascal not snake case ? PktDrop AgentFeature = "PacketsDrop"
DNSTracking AgentFeature = "DnsTacking"
FlowRTT AgentFeature = "FlowRtt" 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. You're right, idk why I had in mind the best practice was upper case 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. done |
||
) | ||
|
||
// `FlowCollectorEBPF` defines a FlowCollector that uses eBPF to collect the flows information | ||
type FlowCollectorEBPF struct { | ||
// Important: Run "make generate" to regenerate code after modifying this file | ||
|
@@ -219,19 +232,17 @@ type FlowCollectorEBPF struct { | |
// +optional | ||
Debug DebugConfig `json:"debug,omitempty"` | ||
|
||
// Enable the Packets drop flows logging feature. This feature requires mounting | ||
// List of additional features to enable. They are all disabled by default. Enabling additional features may have performance impacts. Possible values are:<br> | ||
// - `PKT_DROP`: enable the packets drop flows logging feature. This feature requires mounting | ||
// the kernel debug filesystem, so the eBPF pod has to run as privileged. | ||
// If the spec.agent.eBPF.privileged parameter is not set, an error is reported. | ||
//+kubebuilder:default:=false | ||
//+optional | ||
EnablePktDrop *bool `json:"enablePktDrop,omitempty"` | ||
|
||
// Enable the DNS tracking feature. This feature requires mounting | ||
// If the `spec.agent.eBPF.privileged` parameter is not set, an error is reported.<br> | ||
// - `DNS_TRACKING`: enable the DNS tracking feature. This feature requires mounting | ||
// the kernel debug filesystem hence the eBPF pod has to run as privileged. | ||
// If the spec.agent.eBPF.privileged parameter is not set, an error is reported. | ||
//+kubebuilder:default:=false | ||
//+optional | ||
EnableDNSTracking *bool `json:"enableDNSTracking,omitempty"` | ||
// If the `spec.agent.eBPF.privileged` parameter is not set, an error is reported.<br> | ||
// - `FLOW_RTT` <i>Unsupported (*)</i>: allows enabling flow latency (RTT) calculations in the eBPF agent during TCP handshakes. | ||
// This feature needs both INGRESS and EGRESS direction flow capture and will be disabled if they are not both enabled.<br> | ||
// +optional | ||
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. should we add or we need to allow Features: block with no features ? // +kubebuilder:validation:Required
// +kubebuilder:validation:MinItems:=1 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. I don't think we need that check. We could simply initialize it empty [] 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. yeah I don't even think an empty array initialization is needed, we don't do that in other places (e.g. exporters list) |
||
Features []AgentFeature `json:"features,omitempty"` | ||
} | ||
|
||
// `FlowCollectorKafka` defines the desired Kafka config of FlowCollector | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -155,14 +155,9 @@ func (c *Reconciler) reconcileOpenshiftPermissions( | |
} else { | ||
scc.AllowedCapabilities = AllowedCapabilities | ||
} | ||
if (desired.EnablePktDrop != nil && *desired.EnablePktDrop) || | ||
(desired.EnableDNSTracking != nil && *desired.EnableDNSTracking) { | ||
if helper.IsPktDropEnabled(desired) || helper.IsDNSTrackingEnabled(desired) { | ||
scc.AllowHostDirVolumePlugin = true | ||
} | ||
if (desired.EnablePktDrop != nil && !*desired.EnablePktDrop) && | ||
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. This was added to handle special case where u start with both features on then u just disable one since we don't compare current vs desired we could endup clearing the AllowHostDirVolumePlugin there was an issue about this by @memodi 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. 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. @msherif1234 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. @msherif1234 if you're talking about the nil-check, it's not relevant anymore now, as the new 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. can u try the steps mentioned in the bug shared above to be sure, the reason I added the explicit false to make scc desired different than actual anyway I kind of forget the details its been awhile just make sure the steps showing in the above issue are fine 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. Just tried to reproduce that old ticket, and it works fine: I get no error on the daemonset, pods are updated as expected, flows are flowing with dns/drops info |
||
(desired.EnableDNSTracking != nil && !*desired.EnableDNSTracking) { | ||
scc.AllowHostDirVolumePlugin = false | ||
} | ||
actual := &osv1.SecurityContextConstraints{} | ||
if err := c.Get(ctx, client.ObjectKeyFromObject(scc), actual); err != nil { | ||
if errors.IsNotFound(err) { | ||
|
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.
This is a slice u need to allocate the space then copy content
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.
done