-
Notifications
You must be signed in to change notification settings - Fork 239
Add kubectl retina debug drop command for real-time packet drop monitoring #1673
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: matmerr <6521405+matmerr@users.noreply.github.com>
Co-authored-by: matmerr <6521405+matmerr@users.noreply.github.com>
// Place holder header file that will be replaced by the actual header file during runtime | ||
// DO NOT DELETE | ||
#define ADVANCED_METRICS 1 | ||
#define BYPASS_LOOKUP_IP_OF_INTEREST 0 |
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 should not be part of the PR
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.
Fixed in commit 222d88e - reverted the dynamic.h file that was not part of the intended changes.
Long: "Debug network issues using various Retina debugging tools", | ||
} | ||
|
||
func init() { |
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.
There could be some conflicts with the refactor going on at - #1693
cli/cmd/debug/drop.go
Outdated
dropCmd.Flags().StringVar(&dropOpts.podName, "pod-name", "", "Specific pod name to monitor (optional)") | ||
dropCmd.Flags().StringSliceVar(&dropOpts.ips, "ips", nil, "IP addresses to filter for (optional)") | ||
dropCmd.Flags().BoolVar(&dropOpts.verbose, "verbose", false, "Enable verbose output") | ||
dropCmd.Flags().IntVar(&dropOpts.consoleWidth, "width", 0, "Console width for formatting (auto-detected if 0)") |
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.
I don't see a reason to have consoleWidth
as a flag. It should always just auto-detect.
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.
Fixed in commit 222d88e - removed the --width flag and made console width auto-detection the only behavior. The consoleWidth is now always automatically detected from the terminal.
|
||
The `kubectl retina debug drop` command monitors packet drop events in real-time using eBPF technology. This helps network operators and developers quickly identify and troubleshoot packet loss issues. | ||
|
||
**Key Features:** |
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.
Number of linting errors here. Need to be fixed.
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.
Fixed in commit 222d88e - resolved all markdown linting errors in docs/05-Debug/00-overview.md including missing blank lines around lists, language specification for code blocks, and proper file ending.
docs/05-Debug/01-cli.md
Outdated
|
||
The command displays drop events in a tabular format: | ||
|
||
``` |
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.
Some linting errors here. Need to be fixed.
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.
Fixed in commit 222d88e - resolved all markdown linting errors in docs/05-Debug/01-cli.md including proper heading formatting, blank lines around code blocks, and language specification.
RunE: runDropCommand, | ||
} | ||
|
||
func init() { |
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.
The script under scripts/watch_drops.sh
states Poll drop counters on a specific node every INTERVAL seconds (default 30).
The go code in this change does not have a configurable interval
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.
Fixed in commit 222d88e - added --interval flag with 1s default to match the configurable interval functionality in watch_drops.sh script. The interval controls the MetricsInterval configuration for the dropreason plugin.
…g, revert dynamic.h Co-authored-by: kamilprz <36544756+kamilprz@users.noreply.github.com>
This PR implements a new
kubectl retina debug drop
command that provides real-time monitoring of packet drop events using eBPF, converting the drop debug script functionality into a Go-based CLI subcommand.Features
--output
flag--ips
flagUsage
Output Format
Implementation Details
debug
command group undercli/cmd/debug/
pkg/plugin/dropreason
plugin via event channelsdocs/05-Debug/
sectionRequirements
The command provides helpful error messages when eBPF capabilities are not available, guiding users on common resolution steps.
Fixes #1672.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.