Skip to content

ksail workload network

Inspect live network traffic flows via Cilium Hubble.
When the cluster uses the Cilium CNI, Cilium's eBPF datapath records every
network flow and exposes them through the Hubble Relay API. This command
queries the most recent flows and prints them, so you can debug connectivity,
spot drops, and see which workloads talk to each other without leaving the
terminal.
The command connects to a Hubble Relay address (default localhost:4245).
Port-forward the in-cluster relay first, e.g.:
kubectl -n kube-system port-forward svc/hubble-relay 4245:80
Pass --follow to keep streaming live flows as they happen (like 'kubectl logs
-f'), until you interrupt with Ctrl-C.
Output formats:
- plain: an aligned table (default; one row per flow while following)
- json: a JSON array of flow records, or newline-delimited JSON (one object
per line) while following — both fit scripting / AI consumption
Examples:
# Show the 20 most recent flows
ksail workload network
# Only flows in the "default" namespace, as JSON
ksail workload network --namespace default --output json
# Only the last 100 TCP flows touching a pod
ksail workload network --pod my-app --protocol tcp --last 100
# Stream live flows until Ctrl-C
ksail workload network --follow
Usage:
ksail workload network [flags]
Flags:
--cni CNI Container Network Interface (CNI) to use
-f, --follow Stream flows continuously until interrupted (Ctrl-C)
--last uint Number of most recent flows to fetch (default 20)
-n, --namespace string Filter flows by namespace (source or destination)
-o, --output string Output format: plain, json (default "plain")
--pod string Filter flows by pod-name substring (source or destination)
--protocol string Filter flows by L4 protocol (TCP, UDP, ICMPv4, ICMPv6, SCTP)
--server string Hubble Relay address to query (default "localhost:4245")
Global Flags:
--benchmark Show per-activity benchmark output
--config string Path to config file (default: ksail.yaml found via directory traversal)
--experimental Enable experimental (unstable) commands and features