Skip to content

feat(conformance): Add EPP conformance test for Gateway routing #961

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

Merged
merged 22 commits into from
Jun 21, 2025

Conversation

zetxqx
Copy link
Contributor

@zetxqx zetxqx commented Jun 11, 2025

This pull request introduces a new conformance test, GatewayFollowingEPPRouting, to validate that a Gateway correctly implements routing logic based on an EPP.

The new test suite ensures that the Gateway honors the EPP's endpoint selection. We used the testing-epp to control the EPP behavior using request header. The two test cases are

  1. request header:[pod1IP, pod2IP, pod3IP]: EPP returns pod1IP, pod2IP, pod3IP, gateway should select the first one pod1IP and send traffic to
  2. request header:[pod3IP, pod2IP, pod1IP] EPP returns ppod3IP, pod2IP, pod1IP, gateway should select the first one pod3IP and send traffic to

Verification

The new conformance test was run against the gke-l7-regional-external-managed GatewayClass and passed successfully.

against gke-l7

Test command

go test -v ./conformance -args -debug \
  -gateway-class gke-l7-regional-external-managed \
  -cleanup-base-resources=false \
  -run-test GatwayFollowingEPPRouting

Test results

=== RUN   TestConformance/HTTPRouteInvalidInferencePoolRef
    conformance.go:68: Skipping HTTPRouteInvalidInferencePoolRef: test explicitly skipped
=== RUN   TestConformance/InferencePoolAccepted
    conformance.go:68: Skipping InferencePoolAccepted: test explicitly skipped
=== RUN   TestConformance/InferencePoolResolvedRefsCondition
    conformance.go:68: Skipping InferencePoolResolvedRefsCondition: test explicitly skipped
--- PASS: TestConformance (53.87s)
    --- PASS: TestConformance/GatewayFollowingEPPRouting (51.41s)
        --- PASS: TestConformance/GatewayFollowingEPPRouting/should_route_traffic_to_a_single_designated_pod (0.08s)
        --- PASS: TestConformance/GatewayFollowingEPPRouting/should_route_traffic_to_two_designated_pods (0.09s)
        --- PASS: TestConformance/GatewayFollowingEPPRouting/should_route_traffic_to_all_available_pods (0.10s)
    --- SKIP: TestConformance/HTTPRouteInvalidInferencePoolRef (0.00s)
    --- SKIP: TestConformance/InferencePoolAccepted (0.00s)
    --- SKIP: TestConformance/InferencePoolResolvedRefsCondition (0.00s)
PASS
ok  	sigs.k8s.io/gateway-api-inference-extension/conformance	54.054s

against istio (FAILED)

The istio implementation may still send traffic to pods not selected by EPP.

go test -v ./conformance -args -debug -gateway-class istio -cleanup-base-resources=false -run-test GatewayFollowingEPPRouting

Test results

error log: gateway_following_epp_routing.go:144: Not all the requests are sent to the expectedPods successfully, err: request was handled by an unexpected pod "infra-backend-deployment-678ff64fb-txms2", Reached pods with request counts: map[infra-backend-deployment-678ff64fb-tnlhd:30 infra-backend-deployment-678ff64fb-txms2:32 infra-backend-deployment-678ff64fb-zjwk2:38]

=== RUN   TestConformance/HTTPRouteInvalidInferencePoolRef
    conformance.go:68: Skipping HTTPRouteInvalidInferencePoolRef: test explicitly skipped
=== RUN   TestConformance/InferencePoolAccepted
    conformance.go:68: Skipping InferencePoolAccepted: test explicitly skipped
=== RUN   TestConformance/InferencePoolResolvedRefsCondition
    conformance.go:68: Skipping InferencePoolResolvedRefsCondition: test explicitly skipped
--- FAIL: TestConformance (139.98s)
    --- FAIL: TestConformance/GatewayFollowingEPPRouting (137.31s)
        --- FAIL: TestConformance/GatewayFollowingEPPRouting/should_route_traffic_to_a_single_designated_pod (0.05s)
        --- FAIL: TestConformance/GatewayFollowingEPPRouting/should_route_traffic_to_two_designated_pods (0.05s)
        --- PASS: TestConformance/GatewayFollowingEPPRouting/should_route_traffic_to_all_available_pods (0.05s)
    --- SKIP: TestConformance/HTTPRouteInvalidInferencePoolRef (0.00s)
    --- SKIP: TestConformance/InferencePoolAccepted (0.00s)
    --- SKIP: TestConformance/InferencePoolResolvedRefsCondition (0.00s)
FAIL
FAIL	sigs.k8s.io/gateway-api-inference-extension/conformance	140.176s
FAIL

TODO(all done now)

  1. (Done) Currently the Mock EPP can only accept one endpoint from the request header, I need to add multi-endpoints support to test the case when EPP return multiple endpoints. Extending feat(Conformance): Add a header based filter to make a controllable epp behavior determined by request header. #922
  2. (Done) Need to refactor the test utils. The library our conformance test is depending on need some modification. Currently the library can only make request w/o body. I try to make some minimum change to make this PR.
  3. (Done) Need to figure out a poll and check way to make sure the whole stack is ready to server request.

Copy link

netlify bot commented Jun 11, 2025

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

Name Link
🔨 Latest commit 1a3daae
🔍 Latest deploy log https://app.netlify.com/projects/gateway-api-inference-extension/deploys/6855d5437ce45f0008444470
😎 Deploy Preview https://deploy-preview-961--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 Jun 11, 2025
@k8s-ci-robot k8s-ci-robot requested review from ahg-g and danehans June 11, 2025 03:58
@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 Jun 11, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @zetxqx. 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jun 11, 2025
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 @zetxqx!

@zetxqx zetxqx requested a review from robscott June 11, 2025 22:54
@zetxqx zetxqx mentioned this pull request Jun 12, 2025
12 tasks
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 for all the work on this @zetxqx!

@robscott
Copy link
Member

/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 Jun 13, 2025
@k8s-ci-robot k8s-ci-robot removed the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jun 13, 2025
@LiorLieberman
Copy link
Member

cc: @aslakknutsen

@danehans
Copy link
Contributor

#961 (comment) needs an answer.

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 20, 2025
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 20, 2025
@zetxqx
Copy link
Contributor Author

zetxqx commented Jun 20, 2025

I reverted the dependency on gateway-1.3.1 commit sha and duplicate some code from gateway-api. I also created a github issue #1031 for tracking to remove the duplicate when the gateway-api is released. PTAL @robscott @danehans

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 @zetxqx!

@zetxqx
Copy link
Contributor Author

zetxqx commented Jun 20, 2025

Run the test again

=== NAME  TestConformance/GatewayFollowingEPPRouting
    apply.go:283: 2025-06-20T21:33:39.368887167Z: Deleting httproute-for-primary-gw HTTPRoute
    apply.go:283: 2025-06-20T21:33:39.440315387Z: Deleting conformance-fake-model-server InferenceModel
=== RUN   TestConformance/HTTPRouteInvalidInferencePoolRef
    conformance.go:68: Skipping HTTPRouteInvalidInferencePoolRef: test explicitly skipped
=== RUN   TestConformance/InferencePoolAccepted
    conformance.go:68: Skipping InferencePoolAccepted: test explicitly skipped
=== RUN   TestConformance/InferencePoolHTTPRoutePortValidation
    conformance.go:68: Skipping InferencePoolHTTPRoutePortValidation: test explicitly skipped
=== RUN   TestConformance/InferencePoolInvalidEPPService
    conformance.go:68: Skipping InferencePoolInvalidEPPService: test explicitly skipped
=== RUN   TestConformance/HTTPRouteMultipleRulesDifferentPools
    conformance.go:68: Skipping HTTPRouteMultipleRulesDifferentPools: test explicitly skipped
=== RUN   TestConformance/InferencePoolResolvedRefsCondition
    conformance.go:68: Skipping InferencePoolResolvedRefsCondition: test explicitly skipped
--- PASS: TestConformance (148.79s)
    --- PASS: TestConformance/GatewayFollowingEPPRouting (144.34s)
        --- PASS: TestConformance/GatewayFollowingEPPRouting/should_route_traffic_to_a_single_designated_pod (0.09s)
        --- PASS: TestConformance/GatewayFollowingEPPRouting/should_route_traffic_to_two_designated_pods (0.10s)
        --- PASS: TestConformance/GatewayFollowingEPPRouting/should_route_traffic_to_all_available_pods (0.09s)
    --- SKIP: TestConformance/HTTPRouteInvalidInferencePoolRef (0.00s)
    --- 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	149.046s

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 @zetxqx!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 20, 2025
@robscott
Copy link
Member

#961 (comment) needs an answer.

/hold

Good catch - I do think it's unlikely that we'll be able to consistently line up releases across repos, so some temporary duplication is probably better. I think we can resolve this now and remove the hold.

@zetxqx zetxqx requested a review from danehans June 20, 2025 21:45
@danehans
Copy link
Contributor

/unhold

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 21, 2025
@danehans
Copy link
Contributor

danehans commented Jun 21, 2025

/approve

@zetxqx
Copy link
Contributor Author

zetxqx commented Jun 21, 2025

/retest

@danehans danehans added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 21, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: danehans, robscott, zetxqx

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

@k8s-ci-robot k8s-ci-robot merged commit a0cfd24 into kubernetes-sigs:main Jun 21, 2025
9 checks passed
@aslakknutsen
Copy link
Contributor

@zetxqx Replicas 3 here seems to break HTTPRouteMultipleRulesDifferentPools which is expecting only 1 pod pr pool.

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. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants