Skip to content

feat(k8s): runtime children of the estate's own API groups (#1517) - #1518

Merged
lex00 merged 1 commit into
mainfrom
feat/1517-crd-runtime-sweep
Aug 6, 2026
Merged

lex00 merged 1 commit into
mainfrom
feat/1517-crd-runtime-sweep

Conversation

@lex00

@lex00 lex00 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

The #1077 runtime scan was deliberately scoped to Pods, which made the
runtime tier blind exactly where it says the most: an operator estate's
children are custom resources its controllers made (a MicroVMReplicaSet's
MicroVMs, with proper ownerReferences), and no kind table could
anticipate them.

The scan now also sweeps the API groups the declared estate itself uses:
each declared entity's non-core groupVersion is enumerated through the
cluster's own discovery (K8sClient gains resources(apiVersion),
exposing the cached discovery list), and every namespaced, listable kind
is scanned in the namespaces the observation already touched — the same
open-world inversion behold#74 made for declared CRDs, applied to the
runtime axis, and bounded by the declaration rather than a cluster-wide
sweep. Core stays represented by Pods alone (sweeping every core kind
would walk endpoints and events for nothing), and a swept object with no
owner chain to a declared entity is not reported — the scan is not an
inventory.

Verified live on kubemicrovm-ops (k3d + floci, tier prod-ha):

runtime children: 2
K8s::Lambda::MicroVM microvm-demo/kmv-dev-a-vm-42sgf → workloadReplicaSet
K8s::Lambda::MicroVM microvm-demo/kmv-dev-a-vm-cs7t2 → workloadReplicaSet

— previously zero. k8s suite green (45 describe-resources tests, 3 new);
client 141; core 4033/4033; the pre-existing #1476/#1419 local-table
failures unchanged.

Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01HDqbe9YwXqqpF7VxFp1Drx

The #1077 runtime scan was deliberately scoped to Pods, which made the
runtime tier blind exactly where it says the most: an operator estate's
children are custom resources its controllers made (a MicroVMReplicaSet's
MicroVMs, with proper ownerReferences), and no kind table could
anticipate them.

The scan now also sweeps the API groups the declared estate itself uses:
each declared entity's non-core groupVersion is enumerated through the
cluster's own discovery (K8sClient gains `resources(apiVersion)`,
exposing the cached discovery list), and every namespaced, listable kind
is scanned in the namespaces the observation already touched — the same
open-world inversion behold#74 made for declared CRDs, applied to the
runtime axis, and bounded by the declaration rather than a cluster-wide
sweep. Core stays represented by Pods alone (sweeping every core kind
would walk endpoints and events for nothing), and a swept object with no
owner chain to a declared entity is not reported — the scan is not an
inventory.

Verified live on kubemicrovm-ops (k3d + floci, tier prod-ha):

  runtime children: 2
    K8s::Lambda::MicroVM microvm-demo/kmv-dev-a-vm-42sgf → workloadReplicaSet
    K8s::Lambda::MicroVM microvm-demo/kmv-dev-a-vm-cs7t2 → workloadReplicaSet

— previously zero. k8s suite green (45 describe-resources tests, 3 new);
client 141; core 4033/4033; the pre-existing #1476/#1419 local-table
failures unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HDqbe9YwXqqpF7VxFp1Drx
@lex00
lex00 merged commit f793c3e into main Aug 6, 2026
5 checks passed
@lex00
lex00 deleted the feat/1517-crd-runtime-sweep branch August 6, 2026 01:22
lex00 added a commit that referenced this pull request Aug 9, 2026
…es instead of kinds (#1517) (#1609)

The runtime-children sweep bounded itself by kind: first Pods (#1077),
then the estate's own declared API groups (#1518). Both miss where the
runtime tier says the most — an operator's children are whatever kinds
its controllers make, including kinds in groups the estate never
declares (a CR's Deployments, a chain through a foreign CRD group), and
no kind list can anticipate them.

The sweep now asks the cluster itself. K8sClient gains
preferredGroupVersions() — one groupVersion per served group, from the
same cached root discovery servedGroupVersions reads — and the sweep
lists every listable kind those serve. What bounds it is reach, not a
table:

- namespaced kinds are listed only in the namespaces the declared
  estate touches (owner references cannot cross a namespace);
- cluster-scoped kinds are listed only when a declared cluster-scoped
  entity resolved (a cluster-scoped object's owners are cluster-scoped,
  Kubernetes' own GC rule);
- Events are skipped: they name their subject via involvedObject, never
  ownerReferences, so listing them can only cost;
- outside Pods, a swept object is still only reported when its owner
  chain (or the #1549 label channel) resolves to a declared entity —
  the sweep is not an inventory.

Tri-state honesty extends to the sweep: a kind discovery names but the
sweep cannot list (RBAC denial, a flaking apiserver) becomes a
runtime-sweep:* entry in unobserved — recorded once per kind, naming
the scopes that failed — never a silent gap that would read as "no
runtime children there". A list 404 stays an absence, and declared
resolution is never failed by the sweep.

The k8s lexicon's optional client dependency moves to ^0.42.1 so the
workspace client (which carries the new method) links instead of the
published 0.41.20 nesting under lexicons/k8s.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant