Skip to content

feat: narrow a Pod to some of its pool's providers with an annotation - #144

Merged
InftyAI-Agent merged 5 commits into
InftyAI:mainfrom
kerthcet:feat/pod-providers-annotation
Nov 16, 2026
Merged

InftyAI-Agent merged 5 commits into
InftyAI:mainfrom
kerthcet:feat/pod-providers-annotation

Conversation

@kerthcet

Copy link
Copy Markdown
Member

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?


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>
Copilot AI balanced review requested due to automatic review settings November 15, 2026 23:32
@InftyAI-Agent InftyAI-Agent added needs-triage Indicates an issue or PR lacks a label and requires one. needs-priority Indicates a PR lacks a label and requires one. do-not-merge/needs-kind Indicates a PR lacks a label and requires one. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread README.md Resolved
Comment thread docs/metrics.md Resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 15, 2026 23:34
Signed-off-by: kerthcet <kerthcet@gmail.com>
@kerthcet

Copy link
Copy Markdown
Member Author

/lgtm
/kind feature

@InftyAI-Agent InftyAI-Agent added lgtm Looks good to me, indicates that a PR is ready to be merged. feature Categorizes issue or PR as related to a new feature. and removed do-not-merge/needs-kind Indicates a PR lacks a label and requires one. labels Nov 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

A retry after a providers-annotation update can reuse a mismatched NodeClaim and ungate the Pod with routing that conflicts with its durable placement record.

1 open issue
2 resolved since last review

Review effort: Balanced

return placement{}, false, 0
}

refs, ok := requestedProviders(pod, pool)
Copilot AI balanced review requested due to automatic review settings November 15, 2026 23:38
@kerthcet

Copy link
Copy Markdown
Member Author

/hold

@InftyAI-Agent InftyAI-Agent added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

A critical retry-path issue can leave an existing NodeClaim on Modal while routing the Pod to Kubernetes after an annotation change, causing incorrect provisioning and teardown behavior.

1 open issue

Review effort: Balanced

…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>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 00:39
@InftyAI-Agent InftyAI-Agent removed the lgtm Looks good to me, indicates that a PR is ready to be merged. label Nov 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread internal/webhook/v1/pod_webhook.go Resolved
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>
Copilot AI balanced review requested due to automatic review settings November 16, 2026 01:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread internal/webhook/v1/pod_webhook.go Resolved
@kerthcet

Copy link
Copy Markdown
Member Author

/unhold

@InftyAI-Agent InftyAI-Agent removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 16, 2026
@kerthcet

Copy link
Copy Markdown
Member Author

/lgtm

@InftyAI-Agent InftyAI-Agent added the lgtm Looks good to me, indicates that a PR is ready to be merged. label Nov 16, 2026

@InftyAI-Agent InftyAI-Agent left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved: PR has both lgtm and approved labels

@InftyAI-Agent
InftyAI-Agent merged commit f2ae6c1 into InftyAI:main Nov 16, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. feature Categorizes issue or PR as related to a new feature. lgtm Looks good to me, indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a label and requires one. needs-triage Indicates an issue or PR lacks a label and requires one.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants