feat(kubernetes): pod and container attribution for connections#299
Open
domcyrus wants to merge 1 commit into
Open
feat(kubernetes): pod and container attribution for connections#299domcyrus wants to merge 1 commit into
domcyrus wants to merge 1 commit into
Conversation
474a631 to
209a1f9
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.
209a1f9 to
8bed755
Compare
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.