Skip to content

feat(conformance): Add HTTPRouteMultipleGatewaysDifferentPools test #838

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

Conversation

SinaChavoshi
Copy link
Contributor

@SinaChavoshi SinaChavoshi commented May 15, 2025

This PR introduces a new conformance test, HTTPRouteMultipleGatewaysDifferentPools, which validates a scenario where two distinct HTTPRoute resources, parented by different Gateway resources, successfully reference and route traffic to separate InferencePool backends.

local run results: ( Ran on commit be03841 )

go test -v ./conformance -args -debug     -gateway-class gke-l7-regional-external-managed     -cleanup-base-resources=false     -run-test HTTPRouteMultipleGatewaysDifferentPools
...
=== NAME  TestConformance
    suite.go:451: 2025-06-20T18:48:11.435814261Z: Sleeping 0s for test isolation
=== RUN   TestConformance/InferencePoolResolvedRefsCondition
    conformance.go:68: Skipping InferencePoolResolvedRefsCondition: test explicitly skipped
--- PASS: TestConformance (54.85s)
    --- SKIP: TestConformance/HTTPRouteInvalidInferencePoolRef (0.00s)
    --- PASS: TestConformance/HTTPRouteMultipleGatewaysDifferentPools (47.73s)
        --- PASS: TestConformance/HTTPRouteMultipleGatewaysDifferentPools/Primary_HTTPRoute,_InferencePool,_and_Gateway_path:_verify_status_and_traffic (32.54s)
        --- PASS: TestConformance/HTTPRouteMultipleGatewaysDifferentPools/Secondary_HTTPRoute,_InferencePool,_and_Gateway_path:_verify_status_and_traffic (14.56s)
    --- SKIP: TestConformance/InferencePoolAccepted (0.00s)
    --- SKIP: TestConformance/InferencePoolHTTPRoutePortValidation (0.00s)
    --- SKIP: TestConformance/InferencePoolInvalidEPPService (0.00s)
    --- SKIP: TestConformance/HTTPRouteMultipleRulesDifferentPools (0.00s)
    --- SKIP: TestConformance/InferencePoolResolvedRefsCondition (0.00s)
PASS
ok      sigs.k8s.io/gateway-api-inference-extension/conformance 55.055s

Copy link

netlify bot commented May 15, 2025

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

Name Link
🔨 Latest commit be03841
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/6855ade714d6310008324bae
😎 Deploy Preview https://deploy-preview-838--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 k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 15, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @SinaChavoshi. 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 15, 2025
@spencerhance
Copy link

/cc

@k8s-ci-robot k8s-ci-robot requested a review from spencerhance May 16, 2025 18:16
Copy link

@spencerhance spencerhance left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 16, 2025
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 19, 2025
@spencerhance
Copy link

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 19, 2025
@ahg-g
Copy link
Contributor

ahg-g commented May 20, 2025

/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 May 20, 2025
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 17, 2025
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 17, 2025
@danehans
Copy link
Contributor

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jun 18, 2025
@danehans
Copy link
Contributor

Implementation-specific resources should not be in conformance tests (#838 (comment)).

/hold

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 20, 2025
@SinaChavoshi
Copy link
Contributor Author

https://github.com/kubernetes-sigs/gateway-api-inference-extension/pull/838/files#r2150419700 needs to be resolved before merging.

/hold

sorry was waiting for #982 to merge, this makes the code much simpler as all tests now share the EPP and inferencePool definitions from manifests.yaml

Copy link
Member

@robscott robscott left a comment

Choose a reason for hiding this comment

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

Thanks @SinaChavoshi! This mostly LGTM

Comment on lines +48 to +50
// TODO - Remove this once the upstream timeout has been changed.
modifiedConfig := gatewayconfig.DefaultTimeoutConfig()
modifiedConfig.HTTPRouteMustHaveCondition = 300 * time.Second
Copy link
Member

Choose a reason for hiding this comment

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

We should override this via flag when running tests, but should not have a hardcoded override like this.

Copy link
Contributor

Choose a reason for hiding this comment

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

@robscott I actually did similar thing in https://github.com/kubernetes-sigs/gateway-api-inference-extension/pull/961/files#diff-a3410329c9007a0eb0b2c451387bbf6bf97821df458a0fdf6eb669f9565f0956 . I feel for the inference-gateway conformance tests we need to have a separate setting of timeout. And I feel here DefaultInferenceExtensionTimeoutConfig is a good place to put it in.

Flag is good but I assume we don't want to change the timeout a lot. So maybe hard code here is fine?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I like that idea of having a separate set of defaults for this project. Just want to override something like this where we're hardcoding a value in a way that would make it impossible to override via flag.


const (
eppSelectionHeader = "test-epp-endpoint-selection"
backendPort = 3000
Copy link
Member

Choose a reason for hiding this comment

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

It seems like we should make IP:Port the input here instead of hardcoding port in this function.

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need to provide the port at all. EPP will use the port configured in inferencePool.


primaryGwAddr := k8sutils.GetGatewayEndpoint(t, s.Client, s.TimeoutConfig, primaryGatewayNN)
primarySelector := labels.SelectorFromSet(labels.Set{backendAppLabelKey: primaryBackendLabel})
primaryPod := k8sutils.GetPod(t, s.Client, appBackendNamespace, primarySelector, s.TimeoutConfig.RequestTimeout)
Copy link
Member

Choose a reason for hiding this comment

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

Does this mean that each InferencePool needs to have exactly 1 Pod running? I thought that in other tests we were able to just check the prefix of a Pod name or something similar?

- group: inference.networking.x-k8s.io
kind: InferencePool
name: primary-inference-pool
port: 80
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: this is not needed any more based on #918

- group: inference.networking.x-k8s.io
kind: InferencePool
name: secondary-inference-pool
port: 80
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here, we can remove it

Comment on lines +48 to +50
// TODO - Remove this once the upstream timeout has been changed.
modifiedConfig := gatewayconfig.DefaultTimeoutConfig()
modifiedConfig.HTTPRouteMustHaveCondition = 300 * time.Second
Copy link
Contributor

Choose a reason for hiding this comment

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

@robscott I actually did similar thing in https://github.com/kubernetes-sigs/gateway-api-inference-extension/pull/961/files#diff-a3410329c9007a0eb0b2c451387bbf6bf97821df458a0fdf6eb669f9565f0956 . I feel for the inference-gateway conformance tests we need to have a separate setting of timeout. And I feel here DefaultInferenceExtensionTimeoutConfig is a good place to put it in.

Flag is good but I assume we don't want to change the timeout a lot. So maybe hard code here is fine?


const (
eppSelectionHeader = "test-epp-endpoint-selection"
backendPort = 3000
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't need to provide the port at all. EPP will use the port configured in inferencePool.

Path: path,
Host: hostname,
Headers: map[string]string{
eppSelectionHeader: fmt.Sprintf("%s:%d", targetPod.Status.PodIP, backendPort),
Copy link
Contributor

Choose a reason for hiding this comment

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

only podIP is needed here.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 21, 2025
@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.

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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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/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.

8 participants