Repository navigation
feat: narrow a Pod to some of its pool's providers with an annotation - #144
Conversation
nebula.inftyai.com/providers lists providers by name, as nebula.inftyai.com/regions lists geographies, and narrows the pool's providers for that Pod alone. The pool's order stands and a provider it doesn't list is never added; naming none of them leaves the Pod gated as an invalid request, so a typo can't widen it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The README example requests a provider absent from its NodePool, leaving the Pod gated indefinitely, and the metrics documentation omits an existing invalid-request diagnostic case.
2 open issues
What changed in this PR
This PR adds a per-Pod providers annotation to narrow placement to selected providers already allowed by its NodePool, while preserving the pool’s order.
Changes:
- Filters placement candidates by the annotation and leaves Pods gated when no requested provider matches.
- Adds tests for filtering, ordering, normalization, and invalid requests.
- Documents the annotation and its deferral behavior.
| File | Description |
|---|---|
| README.md | Adds the providers annotation to the workload example. |
| internal/controller/pod_placement_helpers.go | Filters pool providers before placement selection. |
| internal/controller/pod_placement_controller_test.go | Tests provider narrowing and gated invalid requests. |
| docs/metrics.md | Documents provider mismatches as invalid requests. |
| docs/architecture.md | Describes provider narrowing in the placement flow. |
| api/v1alpha1/groupversion_info.go | Defines the providers annotation constant and contract. |
Review effort: Balanced
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: kerthcet <kerthcet@gmail.com>
|
/lgtm |
| return placement{}, false, 0 | ||
| } | ||
|
|
||
| refs, ok := requestedProviders(pod, pool) |
|
/hold |
…laced Placement reads nebula.inftyai.com/providers and nebula.inftyai.com/regions once, into the Pod's NodeClaim, so a later edit would be silently ignored. A gated Pod can still be edited, which is how an invalid request is fixed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
A gated provider edit can cause retries to reuse an incompatible NodeClaim and ungate the Pod with conflicting routing and teardown decisions, while selector-only annotation freezing can block corrections needed to unblock gated Pods.
2 open issues
Review effort: Balanced
A user may set the provider nodeSelector at creation, and admission still gates the Pod. placedByNebula now also needs the gate gone, so such a Pod can still have its placement annotations corrected, or opt out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
A providers annotation edit before gate release can route the Pod to Kubernetes while retaining a Modal NodeClaim, leaving provisioning and teardown tied to the wrong provider.
2 open issues
1 resolved since last review
Review effort: Balanced
|
/unhold |
|
/lgtm |
InftyAI-Agent
left a comment
There was a problem hiding this comment.
Approved: PR has both lgtm and approved labels



nebula.inftyai.com/providers lists providers by name, as nebula.inftyai.com/regions lists geographies, and narrows the pool's providers for that Pod alone. The pool's order stands and a provider it doesn't list is never added; naming none of them leaves the Pod gated as an invalid request, so a typo can't widen it.
What this PR does / why we need it
Which issue(s) this PR fixes
Fixes #
Special notes for your reviewer
Does this PR introduce a user-facing change?