Conversation
`:xray [namespace|all]` opens a live ownership graph, replacing the old stub and closing gap #3 from the k9s parity audit (4.7). Rather than a per-kind tree, it's a single namespace-rooted forest of the workload topology: ns/<name> ├─ deploy → rs → pod → container ├─ sts / ds → pod → container ├─ cronjob → job → pod ├─ job / bare rs → pod └─ standalone pods (no controller) `:xray` defaults to the current namespace; `:xray all` spans the cluster grouped by namespace. Rendering is a real tree, not indented text: box-drawing connectors (├──/└──/│), ▾/▸ expand markers, severity-colored per-node status, and a selectable cursor. Navigate j/k (+ g/G); →/← expand/collapse the node under the cursor, Enter toggles, esc closes. Collapse state is keyed by stable node id so it survives the per-frame rebuild. The graph rebuilds from store state every frame so it tracks the cluster live; opening it adds the workload kinds it draws to the active watch plan so it fills in within a moment. Large graphs truncate with `… N more` nodes (no silent caps). Cross-cutting relations (Service/PVC/ConfigMap/Node — non-ownership, multi-parent edges that don't fit a tree) are intentionally left to the Enter drill-down and describe views. Reuses the existing owner-chain helpers (the log fan-in's deployment/replicaset/pod key lookups). Tests: namespace-rooted tree structure + connectors + expand marker; collapse hides a subtree; arrow-key directed collapse/expand. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
:xray [namespace|all]opens a live ownership graph (closes gap #3 of the k9s parity audit). Instead of a per-kind tree, it's a single namespace-rooted forest of the workload topology::xray= current namespace;:xray all= whole cluster grouped by namespace. Covers deploy→rs→pod, sts/ds→pod, cronjob→job→pod, bare job/rs→pod, standalone pods, all → containers.Rendering
A real tree: box-drawing connectors (
├──/└──/│),▾/▸expand markers, severity-colored status, selectable cursor. Navigatej/k(+g/G);→/←expand/collapse,Entertoggles,esccloses. Collapse state keyed by stable node id (survives the per-frame rebuild).Live
Rebuilds from store state every frame; opening it adds the workload kinds to the active watch plan so it populates within a moment and tracks the cluster. Large graphs truncate with
… N more(no silent caps).Cross-cutting relations (Service/PVC/ConfigMap/Node — non-ownership, multi-parent edges that can't be drawn in a tree) are intentionally left to the Enter drill-down and describe views. The next feature is an operator triage board (the daily-driver "what needs attention" view), which is where the fleet-health value lives.
Testing
make validategreen (104 tests + release build)🤖 Generated with Claude Code