Repository navigation
Closed
Labels
epic:surfacesEpic: behold as an infrastructure viewer inside other tools (INTENTIUS/behold#1049)wave:4Wave 4 of an epic's rollout: can start once earlier waves land
Description
A cluster UI shows one object at a time. Beside it, behold needs "this object, its neighbours in the cluster, and what it reaches outside" from a graph the page already holds, with no server to ask. This issue writes that cut as a pure browser module, keyed by the identity a host passes (group, kind, namespace, name). Part of #1049, phase 4.
Today
- behold has no cut around one resource. The nearest is
downstreamOf(web/chant-pr-marks.js:502), a transitive walk over the componentneedsmap, which covers stacks and not resources. - Search is server-side:
src/search.tsshells out tochant search. The static export replays only theqanswers captured at export time (qis inLENS_PARAMS,src/export.ts:29), so an export cannot answer for an arbitrary object. - chant's
blast:<id>lens has no depth limit and runs in Node. - Cut: around one resource or root, by depth and direction #1067 is the cut around one resource over the graph document.
Change
- A module in
web/, for exampleweb/neighbourhood.js, that imports nothing fromnode:*orsrc/. It takes{ nodes, edges, groups }as/api/graphreturns them. findK8sNode(graph, { group, kind, namespace, name })finds the start node. An object with no namespace joinsdefault, assrc/k8s-edges.tsdoes (line 110). Cluster-scoped kinds match without one.cutAround(graph, startIds, { depth, up, down, outside })walks both edge directions todepthhops. It keeps the groups of kept nodes.outside(default 2) lets the walk go that many hops past the last Kubernetes node.- Cut: around one resource or root, by depth and direction #1067 and this issue share one walk. Whichever applies second wraps the first.
Done when
- Fixture: Deployment
webuses ServiceAccountrunner, which has an edge to agoogle_service_account, which has an edge to a project.cutAroundfromwebat depth 1 withoutside: 2returns all four nodes and their three edges. - The same call with
outside: 0returns the Deployment and the ServiceAccount only. - An identity that is not in the graph returns no nodes and a reason naming the identity.
esbuild web/neighbourhood.js --bundle --platform=browsersucceeds with no Node built-ins, and the PR states the bundle size.- The cut's time on the 49-root
infra/read ofkubernetes/k8s.io(2,979 nodes) is printed.
Depends on
Nothing.
Not in this issue
Placeholder cards for objects the graph does not hold (its own issue). Drawing the cut (each host's issue).
Metadata
Metadata
Assignees
Labels
epic:surfacesEpic: behold as an infrastructure viewer inside other tools (INTENTIUS/behold#1049)wave:4Wave 4 of an epic's rollout: can start once earlier waves land
Activity
feat: estate-read batch 1, readGraph, graph document, contract kinds,…