Skip to content

feat: collect node sizes, instance type, and capacity type - #8

Merged
kfeofantov merged 1 commit into
mainfrom
feat/node-collector
Jul 29, 2026
Merged

kfeofantov merged 1 commit into
mainfrom
feat/node-collector

Conversation

@kfeofantov

Copy link
Copy Markdown
Contributor

Adds the nodes collector — the second half of the idle-capacity picture.

What

  • internal/collector/nodes.go: NodeWatcher (same informer pattern as pods) reporting per node:
    • allocatable / capacity, normalized per ADR 0004 (CPU millicores, memory bytes)
    • instance type: node.kubernetes.io/instance-type, falling back to the deprecated beta label
    • capacity type normalized to spot / on-demand from Karpenter, EKS, GKE (spot + legacy preemptible), and AKS markers; unknown stays empty instead of defaulting to on-demand
  • cmd/agent: runs pod and node watchers concurrently; if either fails the agent exits instead of running half-blind
  • e2e: new TestNodeWatcherAgainstRealCluster asserting the kind control-plane node reports positive allocatable and capacity ≥ allocatable

Scope

Reads exactly the node access already promised in docs/security.md §4 (allocatable/capacity + the two cost-model labels) — no security.md change needed, no other node fields are read.

Verified

  • go test -race ./..., golangci-lint clean
  • e2e on kind: log has node observed with allocatable_cpu_milli=2000, allocatable_memory_bytes=6228185088
  • live binary smoke run against kind reports the node

🤖 Generated with Claude Code

Add a NodeWatcher (same informer pattern as the pod watcher) reporting
per node: allocatable and capacity normalized to millicores/bytes, the
instance-type label (stable name with beta fallback), and capacity type
normalized to spot/on-demand from Karpenter, EKS, GKE, and AKS markers.
Unknown stays empty rather than defaulting to on-demand.

Exactly the node access already promised in docs/security.md §4; no
other node fields are read. The agent runs both watchers concurrently
and exits if either fails.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@kfeofantov
kfeofantov merged commit ab6adeb into main Jul 29, 2026
3 checks passed
@kfeofantov
kfeofantov deleted the feat/node-collector branch August 9, 2026 12:22
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