A CLI tool for diagnosing network connectivity and configuration issues in Kubernetes clusters (RKE2/K3s). It automates the deployment of test DaemonSets, executes checks across nodes, and aggregates the results.
- A valid Kubeconfig (
~/.kube/configor set viaKUBECONFIGenvironment variable) - Cluster RBAC permissions to create
Namespace,ServiceAccount,ClusterRole,ClusterRoleBinding,DaemonSet, andConfigMap.
Download the latest pre-compiled binary from GitHub releases:
# Example for Linux AMD64
curl -sL https://github.com/ryanelliottsmith/network-debugger/releases/latest/download/netdebug-linux-amd64 -o netdebug
chmod +x netdebugThe CLI operates by dynamically deploying a host-network and an overlay-network DaemonSet, passing configuration via a ConfigMap, and reading JSON events from pod logs to aggregate results.
The run subcommand handles deployment, test execution, and cleanup automatically.
Execute the default check suite (dns, ping, ports, conntrack, hostconfig):
./netdebug runExecute specific checks:
./netdebug run --checks=dns,ping,bandwidthExecute a bandwidth test with custom iperf3 arguments, disable the overlay network tests, and retain the DaemonSets for future runs:
./netdebug run --checks=bandwidth --overlay=false --cleanup=false --iperf-args="-t 120"Output formats can be modified using the -o or --output flag (table, json, yaml):
./netdebug run --checks=dns -o jsonDeploy custom image:
./bin/netdebug run --image ghcr.io/ryanelliottsmith/network-debugger:dev-e7516c4The --image tag is also accepted by netdebug deploy install
For granular control, the DaemonSet lifecycle can be managed manually.
Install the DaemonSets:
./netdebug deploy installCheck deployment status:
./netdebug deploy statusRemove the DaemonSets and associated RBAC resources:
./netdebug deploy uninstallTo modify the default Kubernetes manifests (e.g., adding custom tolerations, nodeSelector, or labels), use the template command to output the base YAML:
./netdebug deploy template > manifests.yamlModify manifests.yaml as needed, then apply it manually:
kubectl apply -f manifests.yamlNote: The
netdebugCLI relies on specific names and labels to orchestrate tests. When modifying the templates, do not change the following:
- DaemonSet Names:
netdebug-hostandnetdebug-overlay- ConfigMap Name:
netdebug-config- Pod Labels:
app: netdebugandnetwork-mode: [host|overlay]
ping: ICMP latency and loss between nodes (Host and overlay networks).bandwidth: TCP throughput viaiperf3(Host and overlay networks).ports: TCP accessibility for control plane and worker node default ports (Host only).dns: Resolution forcluster.localand external addresses (Host and overlay networks).hostconfig: IP forwarding, MTU verification, and sysctl parameters.conntrack: Connection tracking table utilization.iptables: (WIP) Detects duplicate rules.