Skip to content

[pluggable parser] add AppProtocol validation in the InferencePool Reconcile loop#2761

Open
zetxqx wants to merge 4 commits intokubernetes-sigs:mainfrom
zetxqx:earlyerrorout
Open

[pluggable parser] add AppProtocol validation in the InferencePool Reconcile loop#2761
zetxqx wants to merge 4 commits intokubernetes-sigs:mainfrom
zetxqx:earlyerrorout

Conversation

@zetxqx
Copy link
Copy Markdown
Contributor

@zetxqx zetxqx commented Apr 2, 2026

What type of PR is this?

/kind feature

What this PR does / why we need it:
Add AppProtocolValidator interface for parsers to implement optionally.

The validation is done in thehealth.go loop. If a mismatch is detected, the health server will return non_serving

I didn't put the validation in startup because inferencePool may installed after the EPP start. Adding to the reconcile loop will prevent some early failure when inferencePool is installed later.

Which issue(s) this PR fixes:

Fixes #2750

Does this PR introduce a user-facing change?:


@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 2, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Apr 2, 2026

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

Name Link
🔨 Latest commit c90b896
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/69d57fd228a828000885bd77
😎 Deploy Preview https://deploy-preview-2761--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.

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

Details 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 danehans and elevran April 2, 2026 08:09
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 2, 2026
return ctrl.Result{}, fmt.Errorf("unsupported API group: %s", c.PoolGKNN.Group)
}

if c.Validator != nil {
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.

I think we should do this in the epp health check: https://github.com/kubernetes-sigs/gateway-api-inference-extension/blob/main/cmd/epp/runner/health.go#L47; return not healthy if the configured parser doesn't support the appProtocol.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

great point, moved the check to health.go

return p.typedName
}

func (p *VllmGRPCParser) ValidateAppProtocol(appProtocol v1.AppProtocol) error {
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.

Instead of placing the burden of validation on the plugin, the plugin should just return the list of protocols it supports and then the caller validates if that matches the value declared on the infPool.

We should have a special match all value, perhaps an empty list, so that plugins like the passthrough one can return to signify that all protocols are supported.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

great suggestion, updated.

for the match all value, currently I made the AppProtocolSupporter a separate interface from the parser interface. So that parser can select not implementing AppProtocolSupporter, not implementing is also considered to be match all

@ahg-g
Copy link
Copy Markdown
Contributor

ahg-g commented Apr 7, 2026

@zetxqx can w please finalize this?

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. kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pluggable parser] EPP should fail at startup on InferencePool appProtocol and gRPC parser mismatch

3 participants