Repository navigation
feat: collect node sizes, instance type, and capacity type - #8
Merged
Merged
Conversation
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>
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.
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:node.kubernetes.io/instance-type, falling back to the deprecated beta labelspot/on-demandfrom Karpenter, EKS, GKE (spot + legacy preemptible), and AKS markers; unknown stays empty instead of defaulting to on-demandcmd/agent: runs pod and node watchers concurrently; if either fails the agent exits instead of running half-blindTestNodeWatcherAgainstRealClusterasserting the kind control-plane node reports positive allocatable and capacity ≥ allocatableScope
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 cleannode observedwith allocatable_cpu_milli=2000, allocatable_memory_bytes=6228185088🤖 Generated with Claude Code