eBPF-driven diagnostic tool for Kubernetes applications
eBPF-driven diagnostic tool for Kubernetes applications
A lightweight yet powerful eBPF-driven diagnostic tool for Kubernetes applications. Podtrace delivers full-stack observability from kernel events to application-layer behavior, all activated on demand, with no prior configuration or instrumentation. With a single command, it uncovers insights across the entire lifecycle of a pod, including network flows, TCP/UDP performance, file system activity, memory behavior, latency patterns, system calls, and high-level application events such as HTTP, DNS, and database queries.
Podtrace attaches eBPF programs directly to the container, allowing it to observe real behavior as it happens at runtime. It automatically correlates low-level kernel activity with high-level application operations, surfacing clear, human-readable diagnostic events that reveal what the pod is experiencing internally.
Instead of assembling data from multiple systems or modifying application code, Podtrace provides deep operational visibility in one place, enabling you to understand:
By combining system-level details, application-layer insights, and real-time event correlation, Podtrace acts as a single on-demand observability lens. This makes it uniquely effective for debugging, performance analysis, and production incident response in Kubernetes environments, especially when time, context, or access is limited.
Podtrace documentation is available in the docs/ directory.
See ROADMAP.md for where the project is heading and
STABILITY.md for what each version promises.
Podtrace runs privileged and loads eBPF into your kernel, so every release artifact ships SLSA v1.0 Build L2 provenance you can verify, and enforce at admission time. See docs/supply-chain.md.
Podtrace ships one binary that runs in three modes. Pick the one that fits your workflow:
Best for ad-hoc, interactive debugging from a workstation or a privileged debug pod. Install via signed tarball:
curl -fsSL https://github.com/gma1k/podtrace/releases/latest/download/podtrace_linux_amd64.tar.gz \
| sudo tar xz -C /usr/local/bin podtrace(/usr/local/bin needs sudo. To install
without sudo, extract to a user-writable directory on $PATH instead, e.g.
mkdir -p ~/.local/bin && tar xz -C ~/.local/bin podtrace.)
Or via krew:
kubectl krew install podtrace
kubectl podtrace -n production my-podThen:
# Realtime trace
podtrace -n production my-pod
# Bounded diagnose with a JSON report
podtrace -n production my-pod --diagnose 30s --export json > report.jsonBy default the CLI spawns a privileged pod on the target pod's node and
runs eBPF there — works on Talos, EKS, GKE, AKS, OpenShift, and any
cluster where your workstation is not the kubelet host. On kind /
minikube / docker-desktop the workstation is the kubelet host, so
add --local to skip the spawn and load eBPF on the workstation
directly (faster, no privileged pod needed):
podtrace --local -n production my-podFor other platforms (linux/arm64, darwin/amd64, darwin/arm64) and
cosign-verifiable installs, see
docs/installation.md#install-the-cli.
The CLI architecture (when to use --local, RBAC needed for the spawn
path, etc.) is documented in
docs/cli-architecture.md.
Full CLI reference: docs/usage.md.
PodTrace CRBest for long-running observability: have the operator watch a selector cluster-wide and stream events through an agent DaemonSet.
apiVersion: podtrace.io/v1alpha1
kind: ExporterConfig
metadata: { name: prod-otlp, namespace: my-app }
spec:
type: otlp
otlp: { endpoint: otel-collector.observability:4318, protocol: http, insecure: true }
---
apiVersion: podtrace.io/v1alpha1
kind: PodTrace
metadata: { name: watch-api, namespace: my-app }
spec:
selector: { matchLabels: { app: api } }
filters: [dns, net]
exporterRef: { name: prod-otlp }kubectl apply -f trace.yaml
kubectl get podtraces.podtrace.io watch-api -n my-app -o yamlOr skip the YAML and let the CLI author the PodTrace for you — target a
whole application by label, across every namespace, and it keeps tracing
through pod restarts and rollouts until you delete it:
# Trace an application everywhere, continuously:
podtrace watch --app api --all-namespaces --exporter prod-otlp
# Or target with any label selector (--label), scoped to one namespace:
podtrace watch --label app=api,tier=web -n my-app --name api-web --exporter prod-otlp
# Render the manifest instead of applying it:
podtrace watch --app api --all-namespaces --print-onlyThe same --app/--label/--all-namespaces targeting also works on the plain
podtrace command for ephemeral tracing (stream to your terminal, no CR):
podtrace --app api -n my-app --diagnose 30s --filter dns,netRule of thumb: podtrace = look now (terminal);
podtrace watch = record continuously (exporter).
Full reference: docs/crd-podtrace.md.
PodTraceSession CRBest for repeatable, GitOps-driven diagnose runs that produce a
shareable report artifact. Equivalent to the CLI's --diagnose mode
but operator-managed and multi-tenant.
apiVersion: podtrace.io/v1alpha1
kind: PodTraceSession
metadata: { name: diag-api, namespace: my-app }
spec:
selector: { matchLabels: { app: api } }
duration: 30s
filters: [dns, net]
exporterRef: { name: prod-otlp }
reportRef:
configMap: { name: api-diag-report }kubectl apply -f session.yaml
kubectl get podtracesession diag-api -n my-app -w # wait for Completed
kubectl get cm api-diag-report -n my-app -o go-template='{{range $k,$v := .data}}{{$v}}{{end}}' | lessThis path runs the same eBPF stack the CLI uses, but as a per-node privileged Job. Results land in three parallel channels:
status.summary — aggregated event countsstatus.jobs[].totalEvents — per-node breakdownreportRef.configMap (or .secret) — full human-readable reportFull reference: docs/crd-podtracesession.md.
PodTraceSchedule CRBest for nightly diagnose sweeps and on-call probes where you want the
last N runs ready to inspect on demand. The schedule fires a fresh
PodTraceSession on every cron tick, owns each child via owner
references, and prunes history per the configured limits.
apiVersion: podtrace.io/v1alpha1
kind: PodTraceSchedule
metadata: { name: nightly-diagnose, namespace: my-app }
spec:
schedule: "0 2 * * *"
concurrencyPolicy: Forbid
successfulSessionsHistoryLimit: 7
sessionTemplate:
spec:
selector: { matchLabels: { app: api } }
duration: 5m
filters: [dns, net]
exporterRef: { name: prod-otlp }Manual one-off trigger from the CLI:
kubectl podtrace schedule trigger nightly-diagnose -n my-appFull reference: docs/crd-podtraceschedule.md.
The fastest path is the one-shot quickstart manifest —
operator + CRDs + a sample nginx workload + PodTraceSession that reaches state: Completed and writes a report to a ConfigMap. Single kubectl apply, no Helm, no clone, no
build toolchain:
kubectl apply -f https://github.com/gma1k/podtrace/releases/latest/download/quickstart.yaml
# Watch the demo session reach Completed (~45-60s end-to-end)
kubectl get podtracesession demo-trace -n podtrace-demo -w
# Read the report
kubectl get cm nginx-trace-report -n podtrace-demo \
-o go-template='{{range $k,$v := .data}}{{$v}}{{end}}'
# Tear down the demo (operator + sample workload + CRDs)
kubectl delete ns podtrace-system podtrace-demo
kubectl delete crd -l app.kubernetes.io/name=podtraceOn OpenShift or any OLM-managed cluster, podtrace is also available via the OperatorHub.io community catalog:
# OpenShift Console: Operators → OperatorHub → search "podtrace" → Install
# Or apply the Subscription manifest directly:
kubectl apply -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata: { name: podtrace, namespace: operators }
spec:
channel: stable
name: podtrace
source: operatorhubio-catalog
sourceNamespace: olm
EOFFor production Helm-managed deployments — custom values, validating webhook, multi-tenant agent config — install via the published OCI chart in GHCR:
helm install podtrace oci://ghcr.io/gma1k/charts/podtrace \
--namespace podtrace-system --create-namespaceVerify the image was built by this repository:
cosign verify ghcr.io/gma1k/podtrace:latest \
--certificate-identity-regexp 'https://github.com/gma1k/podtrace/.+' \
--certificate-oidc-issuer https://token.actions.githubusercontent.comFor prerequisites, supported kernels, and per-distro notes see docs/installation.md and docs/compatibility.md. For chart values and operator architecture see docs/operator.md.
Building from source (for contributors or air-gapped clusters) is covered below under Building.
If you're already a CLI user and want a translation table from the CLI to CRs, see docs/migration.md.
redisCommand / redisCommandArgv calls with command name and latency (no application changes required)No open issues yet, or sync has not completed.