Add kubectl retina debug drop command for real-time packet drop monitoring#1673
Add kubectl retina debug drop command for real-time packet drop monitoring#1673
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.
this should not be part of the PR
There was a problem hiding this comment.
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.
There could be some conflicts with the refactor going on at - #1693
| 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.
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.
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.
Number of linting errors here. Need to be fixed.
There was a problem hiding this comment.
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.
|
|
||
| The command displays drop events in a tabular format: | ||
|
|
||
| ``` |
There was a problem hiding this comment.
Some linting errors here. Need to be fixed.
There was a problem hiding this comment.
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.
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.
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 dropcommand that provides real-time monitoring of packet drop events using eBPF, converting the drop debug script functionality into a Go-based CLI subcommand.Features
--outputflag--ipsflagUsage
Output Format
Implementation Details
debugcommand group undercli/cmd/debug/pkg/plugin/dropreasonplugin 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.