Skip to content

feat(discovery): DaemonSet discovery with scheduling predicates - #10

Merged
diranged merged 4 commits into
mainfrom
feature/phase2-daemonset-discovery
Mar 28, 2026
Merged

diranged merged 4 commits into
mainfrom
feature/phase2-daemonset-discovery

Conversation

@diranged

Copy link
Copy Markdown
Contributor

Summary

  • Implements Phase 2 (DaemonSet Discovery) of the node readiness controller
  • Uses upstream k8s.io/component-helpers scheduling predicates to evaluate nodeSelector, nodeAffinity, and tolerations against each node
  • Strips configured startup taints before toleration evaluation to determine steady-state DaemonSet scheduling
  • Adds configurable exclusions by namespace/name and by label selector (self-service opt-out)
  • Wires discovery into the reconciler with metrics instrumentation

Changes

  • internal/discovery/discovery.go — Core discovery algorithm with ExpectedDaemonSets(), startup taint stripping, synthetic pod construction, and exclusion logic
  • internal/discovery/discovery_test.go — 16 unit tests covering scheduling predicates, taint stripping, exclusions, and edge cases
  • pkg/config/config.go — Added ByLabel exclusion support with LabelSelector and LabelSelectorRequirement types
  • internal/controller/node_readiness_controller.go — Wired in discovery, logs discovered DaemonSets, emits per-node gauge metric
  • internal/controller/node_readiness_controller_test.go — Updated tests for new Discovery field
  • cmd/main.go — Creates discovery instance and passes to reconciler

Test plan

  • All 16 discovery unit tests pass locally
  • All controller unit tests pass locally
  • E2E tests pass locally (KIND cluster)
  • go vet clean
  • CI passes

Closes #6

🤖 Generated with Claude Code

diranged and others added 4 commits March 27, 2026 19:37
…ates

Add Phase 2 of the node readiness controller: DaemonSet discovery that
determines which DaemonSets should run on a given node in steady state.

Uses upstream k8s.io/component-helpers scheduling predicates to evaluate
nodeSelector, nodeAffinity, and toleration matching. Startup taints are
stripped before evaluation so discovery answers "will this DS run after
initialization completes?"

Includes configurable exclusions by namespace/name and by label selector
for self-service opt-out.

Closes #6

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…heck)

- Fix import ordering in discovery.go (gofmt)
- Rename shadowed 'client' param to 'cl' in New()
- Rename shadowed 'labels' params to 'nodeLabels'/'dsLabels' in tests
- Use ds.Labels instead of ds.ObjectMeta.Labels (staticcheck QF1008)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…param)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@diranged
diranged marked this pull request as ready for review March 28, 2026 03:02
@diranged
diranged merged commit 70bfebc into main Mar 28, 2026
3 checks passed
@diranged
diranged deleted the feature/phase2-daemonset-discovery branch March 28, 2026 03:02
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.

[project] Phase 2: DaemonSet Discovery

1 participant