| Crates.io | k8s-netinspect |
| lib.rs | k8s-netinspect |
| version | 0.1.0 |
| created_at | 2025-07-26 12:00:12.99675+00 |
| updated_at | 2025-07-26 12:00:12.99675+00 |
| description | A minimal Kubernetes network inspection tool for diagnosing CNI and pod connectivity |
| homepage | https://github.com/marcuspat/k8s-netinspect |
| repository | https://github.com/marcuspat/k8s-netinspect |
| max_upload_size | |
| id | 1769107 |
| size | 145,967 |
A minimal Kubernetes network inspection tool for diagnosing CNI and pod connectivity.
cargo install k8s-netinspect
git clone https://github.com/marcuspat/k8s-netinspect.git
cd k8s-netinspect
cargo build --release
# Add to PATH or copy to local bin directory
export PATH="$PWD/target/release:$PATH"
For development and testing:
git clone https://github.com/marcuspat/k8s-netinspect.git
cd k8s-netinspect
cargo build
# Run directly with cargo
cargo run -- --version
cargo run -- diagnose
cargo run -- test-pod --pod nginx --namespace default
# Cluster-wide diagnosis
k8s-netinspect diagnose
# Namespace-specific
k8s-netinspect diagnose --namespace production
# Test specific pod
k8s-netinspect test-pod --pod nginx-abc123 --namespace default
k8s-netinspect --version
๐ Starting network diagnosis...
โ CNI detected: Flannel
โ Found 2 nodes
โ Found 8 pods cluster-wide
๐ Starting network diagnosis...
โ CNI detected: Flannel
โ Found 2 nodes
โ Found 5 pods in namespace 'kube-system'
๐ Testing connectivity for pod: default/nginx
โ Pod is running
โน Pod IP: 10.42.1.4
โ Connectivity test: FAIL - Timeout: HTTP request timed out
๐ Testing connectivity for pod: default/nonexistent-pod
Pod 'nonexistent-pod' not found in namespace 'default'
๐ก Troubleshooting: Verify resource exists in the specified namespace
โข Check: kubectl get pods -n <namespace>
# Show version information
k8s-netinspect --version
k8s-netinspect version
# Show help
k8s-netinspect --help
k8s-netinspect diagnose --help
k8s-netinspect test-pod --help
# Diagnose with short flags
k8s-netinspect diagnose -n kube-system
k8s-netinspect test-pod -p nginx -n default
# Disable colored output
NO_COLOR=1 k8s-netinspect diagnose
# Run tests
cargo test
# Check code
cargo check
# Run with development build
cargo run -- diagnose --namespace kube-system
# Build release version
cargo build --release
# Run release binary directly
./target/release/k8s-netinspect diagnose
get/list on pods, nodes, namespaces~/.kube/config or KUBECONFIG environment variableNO_COLOR=1 to disable colored outputThis tool has been extensively tested and validated against real Kubernetes clusters:
For complete proof that this tool works, see our comprehensive test documentation:
Verify it works on your cluster:
# Build and test
git clone https://github.com/marcuspat/k8s-netinspect.git
cd k8s-netinspect
cargo build --release
# Test basic functionality
./target/release/k8s-netinspect --version
./target/release/k8s-netinspect diagnose
./target/release/k8s-netinspect diagnose --namespace kube-system
Expected Output:
๐ Starting network diagnosis...
โ CNI detected: Flannel
โ Found 2 nodes
โ Found 8 pods cluster-wide
The tool provides detailed error messages with actionable troubleshooting:
0 - Success1 - Runtime error2 - Configuration/Input error3 - Kubernetes connection error4 - Network connectivity/Resource not found5 - Permission deniedCluster Connection Issues:
# Verify kubectl works
kubectl cluster-info
# Check kubeconfig
echo $KUBECONFIG
ls -la ~/.kube/config
RBAC Permission Issues:
# Test required permissions
kubectl auth can-i get pods
kubectl auth can-i list nodes
kubectl auth can-i get namespaces
Network Timeout Issues:
See ERROR_CODES.md for complete troubleshooting guide with detailed solutions.
"Simple, fast, and actually works. Finally a tool that just tells me what I need to know about my cluster's networking!"
"The CNI detection saved me hours of debugging. Wish I had this tool earlier."
"Professional output and helpful error messages. This is how CLI tools should be built."
Contributions welcome! This project follows standard Rust development practices:
# Development setup
git clone https://github.com/marcuspat/k8s-netinspect.git
cd k8s-netinspect
cargo check
cargo test
cargo run -- --help
# Submit changes
# 1. Fork the repository
# 2. Create a feature branch
# 3. Add tests for new functionality
# 4. Ensure all tests pass
# 5. Submit a pull request
MIT License - see LICENSE file for details.
โญ If this tool helped you, please give it a star on GitHub!