Skip to content

API: Adds default status condition to InferencePool #830

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 1 commit into
base: main
Choose a base branch
from

Conversation

danehans
Copy link
Contributor

Adds default status condition to the InferencePool API.

Fixes #825

Copy link

netlify bot commented May 13, 2025

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

Name Link
🔨 Latest commit e82eeea
🔍 Latest deploy log https://app.netlify.com/sites/gateway-api-inference-extension/deploys/68239e7d16242c0008053378
😎 Deploy Preview https://deploy-preview-830--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 site configuration.

@k8s-ci-robot k8s-ci-robot requested a review from ahg-g May 13, 2025 19:24
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 13, 2025
@k8s-ci-robot k8s-ci-robot requested a review from Jeffwan May 13, 2025 19:24
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 13, 2025
@danehans
Copy link
Contributor Author

/cc @robscott

Tested in my dev cluster:

$ kubectl get inferencepool/test -o yaml
...
status:
  parent:
  - conditions:
    - lastTransitionTime: "1970-01-01T00:00:00Z"
      message: Waiting for controller
      reason: Pending
      status: Unknown
      type: Accepted
    parentRef: {}

@k8s-ci-robot k8s-ci-robot requested a review from robscott May 13, 2025 19:25
Signed-off-by: Daneyon Hansen <daneyon.hansen@solo.io>
@kfswain
Copy link
Collaborator

kfswain commented May 13, 2025

/approve

Will leave final stamp to @robscott

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danehans, kfswain

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

The pull request process is described 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

@danehans
Copy link
Contributor Author

danehans commented May 15, 2025

Since the default parent status contains an empty parentRef, the entry persists even after a Gateway adds a parent status entry. For example:

$ kubectl get inferencepool/vllm-llama3-8b-instruct -o yaml
...
status:
  parent:
  - conditions:
    - lastTransitionTime: "1970-01-01T00:00:00Z"
      message: Waiting for controller
      reason: Pending
      status: Unknown
      type: Accepted
    parentRef: {}
  - conditions:
    - lastTransitionTime: "2025-05-15T00:04:05Z"
      message: InferencePool is accepted by controller kgateway.dev/kgateway
      reason: Accepted
      status: "True"
      type: Accepted
    - lastTransitionTime: "2025-05-15T00:04:05Z"
      message: All InferencePool references are resolved
      reason: ResolvedRefs
      status: "True"
      type: ResolvedRefs
    parentRef:
      kind: Gateway
      name: inference-gateway

We should update the InferencePool API to define the expected behavior of the default PoolStatus. For example:

  1. A controller that adds itself as a status parent must remove the default parent status if it exists.
  2. A controller that removes itself as a status parent and no other parents are listed in the InferencePool status, must add the default parent status.

Thoughts @robscott

@robscott
Copy link
Member

Thanks for doing this @danehans!

We should update the InferencePool API to define the expected behavior of the default PoolStatus. For example:

  1. A controller that adds itself as a status parent must remove the default parent status if it exists.
  2. A controller that removes itself as a status parent and no other parents are listed in the InferencePool status, must add the default parent status.

Completely agree. I think 1) is a MUST, while 2) is a SHOULD. If you can add this to API Spec, I'll LGTM.


// Status defines the observed state of InferencePool.
//
// +kubebuilder:default={parent: {{parentRef: {}, conditions: {{type: "Accepted", status: "Unknown", reason: "Pending", message: "Waiting for controller", lastTransitionTime: "1970-01-01T00:00:00Z"}}}}}
Copy link
Member

Choose a reason for hiding this comment

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

What if instead of an empty parentRef, we filled it with something like {kind: Status, name: default}, or some kind of similar distinction so it's easier for controllers to know that they can safely remove this.

@danehans
Copy link
Contributor Author

cc @SinaChavoshi related to conformance tests

@nirrozenbaum
Copy link
Contributor

/test pull-gateway-api-inference-extension-test-e2e-main

@kfswain
Copy link
Collaborator

kfswain commented Jun 16, 2025

Bump on this PR, the conversation makes sense to me. I think implementation of that will put this PR in a good state.

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InferencePool Status Condition Defaulting
5 participants