feat(kubernetes): pod and container attribution for connections#299
Merged
Conversation
domcyrus
force-pushed
the
feat/kubernetes-attribution
branch
3 times, most recently
from
May 21, 2026 19:53
209a1f9 to
8bed755
Compare
domcyrus
force-pushed
the
feat/kubernetes-attribution
branch
from
July 3, 2026 08:46
8bed755 to
8287159
Compare
Add an optional `kubernetes` feature (off by default, no extra dependencies)
that attributes connections to their owning pod and container on a node:
- cgroup parser maps a PID to pod UID + container ID via /proc/<pid>/cgroup
- cross-namespace socket-table walker reads per-PID /proc/<pid>/net/{tcp,udp},
which is netns-aware, so pod-owned sockets are attributed under hostNetwork
- pod/container names resolved from the kubelet log directories
(/var/log/containers, /var/log/pods): runtime-agnostic, no CRI socket and no
kubelet auth
- surfaced in the TUI details pane, JSONL and PCAP exports, and the pod:, ns:,
container: filter keywords
- `--kubernetes <auto|on|off>` controls it at runtime; `auto` (the default)
enables only when running inside a pod, detected via KUBERNETES_SERVICE_HOST
- Landlock read access extended to the kubelet log dirs when enabled, so name
resolution keeps working under the sandbox
The container image is built with the feature enabled (CARGO_FEATURES build-arg);
native installs (cargo/brew/deb/rpm) leave it off and stay lean.
domcyrus
force-pushed
the
feat/kubernetes-attribution
branch
from
July 3, 2026 08:49
8287159 to
4bacb3d
Compare
This was referenced Jul 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add an optional
kubernetesfeature (off by default, no extra dependencies) that attributes connections to their owning pod and container on a node:The container image enables the feature by default via the CARGO_FEATURES build-arg; native installs stay default-off.