aperf
aperf copied to clipboard
feat: Add kubectl plugin support and enhance EKS aperf script
Summary
This PR transforms the EKS aperf script into a kubectl plugin and adds several enhancements to improve usability and automation.
Changes
1. Kubectl Plugin Support
-
Renamed
eks-aperf.sh→kubectl-aperfto follow kubectl plugin naming conventions - Users can now install and run as:
kubectl aperf [options] - Added installation instructions to README-EKS.md
2. Enhanced Script Features
Automatic Taint Handling
- Automatically detects node taints using
kubectl get nodeandjq - Dynamically generates tolerations in the pod spec
- Enables aperf to run on tainted nodes without manual configuration
Configurable Report Names
- Added
--report-nameparameter (default:aperf_record) - Allows users to specify custom names for better organization
- Example:
--report-name="loadtest_run1"
Automatic Report Extraction and Browser Opening
- Automatically extracts the tar.gz report after collection
- Opens
index.htmlin the default browser (configurable via--open-browser) - Cross-platform support for macOS (
open) and Linux (xdg-open) - Default behavior:
--open-browser=true
Improved Error Handling
- Added graceful handling for missing metrics-server
- Shows helpful messages when
kubectl topis unavailable - Better error messages with debug output
3. Documentation Updates
- Updated all script references from
eks-aperf.shtokubectl-aperf - Added kubectl plugin installation section
- Added Krew plugin manager documentation (for future distribution)
- Updated usage examples throughout README-EKS.md
New Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
--report-name |
string | aperf_record |
Custom name for aperf record/report |
--open-browser |
boolean | true |
Automatically open report in browser |
Testing
Tested on:
✅ macOS (Darwin) with tainted EKS nodes ✅ Automatic browser opening on macOS ✅ Custom report names ✅ Nodes with multiple taints
Breaking Changes
None. The script maintains backward compatibility with all existing parameters.
Future Work
- Submit to official Krew index for wider distribution
- Add support for multiple nodes in a single run
- Add report comparison features
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.