Skip to content

feat: avoid duplicate of InferencPool golang types #1201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

capri-xiyue
Copy link
Contributor

avoid duplicate of InferencPool golang types following https://github.com/kubernetes-sigs/gateway-api/blob/093f6538409c071e906856bd1ce4072204fb3f08/apis/v1beta1/gateway_types.go#L48-L55.

It comes with the limitation that the crd-gen will just generate v1 InferencePool CRD and won't generate alpha InferencePool CRD. It is probably because we are using https://github.com/kubernetes-sigs/gateway-api/blob/093f6538409c071e906856bd1ce4072204fb3f08/apis/v1beta1/gateway_types.go#L48-L55.
for InferencePool here with v1 and alpha InferencePool actually belongs to different groups, one with inferencepools.inference.networking.k8s.io and the other with inferencepools.inference.networking.x-k8s.io

The PR will cause

  1. removal of inferencepools.inference.networking.x-k8s.io InferencePool CRD
  2. removal of deepcopy generated code of any fields related to alpha type InferencePool like EndpointPickerConfig and InferencePoolSpec , only InferencePool and InferencePoolList will be kept.
  3. Any inferencepools.inference.networking.x-k8s.io InferencePool CRD no longer exists, any test including inferencepools.inference.networking.x-k8s.io InferencePool CRD will need to get removed.

Here is the graph

InferencePool API Version Group API Types Generated Client CRD
v1alpha2 inference.networking.x-k8s.io Yes Yes No
v1 inference.networking.k8s.io Yes(use type InferencePool v1.InferencePool syntax) Yes Yes

Rationale
We'd encourage users and controllers to exclusively focus on the v1 API going forward, thus we omit the v1alpha2 CRD from the release. However, this PR leaves controllers with the option to support both v1a2 and v1 concurrently. An approach is to represent alpha InferencePool in v1 InferencePool but override the group to inference.networking.x-k8s.io

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 22, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: capri-xiyue
Once this PR has been reviewed and has the lgtm label, please assign terrytangyuan for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested review from kfswain and liu-cong July 22, 2025 00:59
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 22, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @capri-xiyue. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jul 22, 2025
@capri-xiyue
Copy link
Contributor Author

/assign @robscott

Copy link

netlify bot commented Jul 22, 2025

Deploy Preview for gateway-api-inference-extension ready!

Name Link
🔨 Latest commit b988eac
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/6887edafeee28300086ae565
😎 Deploy Preview https://deploy-preview-1201--gateway-api-inference-extension.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@liu-cong
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 22, 2025
@capri-xiyue
Copy link
Contributor Author

/retest

@robscott
Copy link
Member

This approach makes sense to me, thanks @capri-xiyue!

/lgtm
/cc @danehans

@k8s-ci-robot k8s-ci-robot requested a review from danehans July 23, 2025 21:08
@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 23, 2025
# Conflicts:
#	config/crd/bases/inference.networking.x-k8s.io_inferencepools.yaml
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jul 28, 2025
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 28, 2025
@capri-xiyue
Copy link
Contributor Author

This approach makes sense to me, thanks @capri-xiyue!

/lgtm /cc @danehans

@danehans Can you help review this PR?

@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants