generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 105
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
SinaChavoshi
wants to merge
105
commits into
kubernetes-sigs:main
Choose a base branch
from
SinaChavoshi:inf_pool_tests_12
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+162
−0
Open
Changes from all commits
Commits
Show all changes
105 commits
Select commit
Hold shift + click to select a range
87d1756
copy of accepted inference pool test to start from.
SinaChavoshi a9dcb62
add yaml file for the test
SinaChavoshi c36e5f8
update time out
SinaChavoshi aaf23e2
update the yaml file to add port 9002
SinaChavoshi 2a67e7d
read timeout config from local repo
SinaChavoshi 8ac7d72
remove excess comments
SinaChavoshi c859896
copy from existing test to start with
SinaChavoshi fe540a7
update test and add gateway to main manifest
SinaChavoshi 63fedab
fix spelling error
SinaChavoshi 66f325d
correct spelling for scenarios
SinaChavoshi fd0fa10
check route condition on RouteConditionResolvedRefs
SinaChavoshi 68812d7
check RouteConditionResolvedRefs instead of Reconciled
SinaChavoshi 59b1f9c
Merge branch 'main' into inf_pool_tests_11
SinaChavoshi 8a078dc
remove empty lines in yaml
SinaChavoshi c55a803
set optional/defaulted fields as unspecified
SinaChavoshi 5efaeb2
add new line at the end of yaml files.
SinaChavoshi 2cd8dab
delete blank lines in yaml files.
SinaChavoshi 26704a1
change variable names to use primary / secondary
SinaChavoshi bb62da7
add to do for name change across the project.
SinaChavoshi 796b584
fix comment
SinaChavoshi 403b588
Merge branch 'main' into inf_pool_tests_12
SinaChavoshi 6506d44
change all variable names to use primary/secondary consistantly
SinaChavoshi dafd21e
add to do for http route testing
SinaChavoshi ecf11e4
HTTPRouteMustBeAcceptedAndResolved
SinaChavoshi f1ce162
add helper method.
SinaChavoshi f3d8e8c
using helper method for pool route accepted.
SinaChavoshi 1cd8790
combline pool and route accpetnace
SinaChavoshi 44b1427
add http route validation
SinaChavoshi c6bacb4
Merge branch 'main' into inf_pool_tests_11
SinaChavoshi d15c25e
Merge branch 'main' into inf_pool_tests_12
SinaChavoshi 1451a90
remove extra comments and yaml fields.
SinaChavoshi 271b7a8
Merge branch 'main' into inf_pool_tests_11
SinaChavoshi adcc104
Merge branch 'main' into inf_pool_tests_12
SinaChavoshi 1535ccc
remove duplicate method
SinaChavoshi c92a402
fix timeout
SinaChavoshi ff25051
fix timeout
SinaChavoshi 5a61a70
change varialbe names to use primary secondary consistently.
SinaChavoshi 6fa352d
remove extra comments
SinaChavoshi 5f1bcad
factor out common code
SinaChavoshi e5fc860
Add actual http traffic validation using echo-basic
SinaChavoshi 62791b5
remove extra comments from manifest
SinaChavoshi 2f08131
remove modifiedTimeoutConfig.HTTPRouteMustHaveCondition per review co…
SinaChavoshi cf587a6
remove modifiedTimeoutConfig.HTTPRouteMustHaveCondition per review co…
SinaChavoshi afc8bc3
remove excessive logging from conformance.go
SinaChavoshi 8588183
Update conformance/tests/basic/httproute_multiple_gateways_different_…
SinaChavoshi 8b6a873
Update conformance/tests/basic/httproute_multiple_gateways_different_…
SinaChavoshi efe3990
Update conformance/tests/basic/httproute_multiple_gateways_different_…
SinaChavoshi b63459d
Update conformance/tests/basic/httproute_multiple_gateways_different_…
SinaChavoshi b903d8f
Update conformance/tests/basic/httproute_multiple_gateways_different_…
SinaChavoshi 2d52812
Remove unecessary logs for accpeted reason.
SinaChavoshi fc2a410
Merge remote-tracking branch 'upstream/main'
SinaChavoshi 939ae57
Remove all comments from yaml and go files and fix yaml
SinaChavoshi d34457a
Merge remote-tracking branch 'upstream/main'
SinaChavoshi 753917a
Merge remote-tracking branch 'upstream/main'
SinaChavoshi f4bcc9a
Merge branch 'main' into inf_pool_tests_11
SinaChavoshi d5530dc
Merge remote-tracking branch 'upstream/main'
SinaChavoshi 0ce459c
Merge branch 'main' into inf_pool_tests_11
SinaChavoshi 3b884d6
intermediate update
SinaChavoshi d90eae0
fix the test run
SinaChavoshi 73731e3
factor out common code
SinaChavoshi b57fb8a
Merge remote-tracking branch 'upstream/main'
SinaChavoshi 6ee73d5
Merge branch 'main' into inf_pool_tests_11
SinaChavoshi b239930
move epp def to shared manifest
SinaChavoshi 66b8426
remove extra comments
SinaChavoshi 9432280
revert back to two epps
SinaChavoshi 4b1f44a
Merge branch 'main' into inf_pool_tests_12
SinaChavoshi 450a5c5
Merge branch 'inf_pool_tests_11' into inf_pool_tests_12
SinaChavoshi 5990c51
update to use epp filter
SinaChavoshi 392171d
remove extra comments
SinaChavoshi 117652e
Merge remote-tracking branch 'upstream/main'
SinaChavoshi ad82e88
Merge remote-tracking branch 'upstream/main' into inf_pool_tests_11
SinaChavoshi ab4e4bc
Merge remote-tracking branch 'upstream/main' into inf_pool_tests_12
SinaChavoshi 04f52f3
add to do for epp image
SinaChavoshi d6b588e
switch to GeneralMustHaveConditionTimeout
SinaChavoshi 112d878
undo gateway version changes
SinaChavoshi 120feb3
remove unused HTTPRouteMustHaveConditions
SinaChavoshi 8214cdf
update doc string for GetPod
SinaChavoshi 76cb644
update docstring
SinaChavoshi f50054f
Merge branch 'inf_pool_tests_11' into inf_pool_tests_12
SinaChavoshi b235dbd
fix defaults in timing.go
SinaChavoshi 5dca67b
Remove resource type from names in manifests.
SinaChavoshi f2c0602
remove type from name
SinaChavoshi daeb8e6
remove health check
SinaChavoshi 79b3015
Merge remote-tracking branch 'upstream/main'
SinaChavoshi f1ab79f
Merge remote-tracking branch 'upstream/main' into inf_pool_tests_11
SinaChavoshi 81562a2
add todo for combining getpod methods
SinaChavoshi 871d4d6
Merge branch 'inf_pool_tests_11' into inf_pool_tests_12
SinaChavoshi ae33369
Merge remote-tracking branch 'upstream'
SinaChavoshi 43c1fa1
Merge branch 'main' into inf_pool_tests_12
SinaChavoshi 182ee70
remove duplicate methods
SinaChavoshi 2afea17
Merge remote-tracking branch 'upstream/main' into inf_pool_tests_12
SinaChavoshi 948956c
revert changes to conformance.go
SinaChavoshi eae8202
revert chagnes to conformance.go
SinaChavoshi e88bf77
revert changes to helpers.go
SinaChavoshi 89869d7
use epp and pool from shared manifest
SinaChavoshi be03841
add todo to factor out common constants
SinaChavoshi 7a9133c
Merge remote-tracking branch 'upstream' into inf_pool_tests_12
SinaChavoshi 810e055
remove port number for EPP call
SinaChavoshi 17ab77b
remove port number for inf pool ref
SinaChavoshi fbce2d5
use GetPodsWithLabel
SinaChavoshi af6b681
removed unused method
SinaChavoshi 22bf7f9
fix routing issue
SinaChavoshi d491509
switch to using MakeRequestAndExpectEventuallyConsistentResponse
SinaChavoshi 413ec25
undo changes to GatewayFollowingEPPRouting
SinaChavoshi 0b94f9f
revert changes to traffic.go
SinaChavoshi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
118 changes: 118 additions & 0 deletions
118
conformance/tests/basic/httproute_multiple_gateways_different_pools.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
/* | ||
Copyright 2025 The Kubernetes Authors. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package basic | ||
|
||
import ( | ||
"net/http" | ||
"testing" | ||
|
||
"k8s.io/apimachinery/pkg/types" | ||
"sigs.k8s.io/gateway-api/conformance/utils/suite" | ||
|
||
"sigs.k8s.io/gateway-api-inference-extension/conformance/tests" | ||
k8sutils "sigs.k8s.io/gateway-api-inference-extension/conformance/utils/kubernetes" | ||
"sigs.k8s.io/gateway-api-inference-extension/conformance/utils/traffic" | ||
) | ||
|
||
func init() { | ||
tests.ConformanceTests = append(tests.ConformanceTests, HTTPRouteMultipleGatewaysDifferentPools) | ||
} | ||
|
||
var HTTPRouteMultipleGatewaysDifferentPools = suite.ConformanceTest{ | ||
ShortName: "HTTPRouteMultipleGatewaysDifferentPools", | ||
Description: "Validates two HTTPRoutes on different Gateways successfully referencing different InferencePools and routes traffic accordingly.", | ||
Manifests: []string{"tests/basic/httproute_multiple_gateways_different_pools.yaml"}, | ||
Test: func(t *testing.T, s *suite.ConformanceTestSuite) { | ||
const ( | ||
appBackendNamespace = "gateway-conformance-app-backend" | ||
infraNamespace = "gateway-conformance-infra" | ||
|
||
primaryGatewayName = "conformance-primary-gateway" | ||
routeForPrimaryGWName = "route-for-primary-gateway" | ||
primaryPoolName = "primary-inference-pool" | ||
primaryBackendPodName = "primary-inference-model-server" | ||
primaryRoutePath = "/test-primary-gateway" | ||
primaryRouteHostname = "primary.example.com" | ||
|
||
secondaryGatewayName = "conformance-secondary-gateway" | ||
routeForSecondaryGWName = "route-for-secondary-gateway" | ||
secondaryPoolName = "secondary-inference-pool" | ||
secondaryBackendPodName = "secondary-inference-model-server" | ||
secondaryRoutePath = "/test-secondary-gateway" | ||
secondaryRouteHostname = "secondary.example.com" | ||
) | ||
|
||
routeForPrimaryGWNN := types.NamespacedName{Name: routeForPrimaryGWName, Namespace: appBackendNamespace} | ||
routeForSecondaryGWNN := types.NamespacedName{Name: routeForSecondaryGWName, Namespace: appBackendNamespace} | ||
primaryPoolNN := types.NamespacedName{Name: primaryPoolName, Namespace: appBackendNamespace} | ||
secondaryPoolNN := types.NamespacedName{Name: secondaryPoolName, Namespace: appBackendNamespace} | ||
primaryGatewayNN := types.NamespacedName{Name: primaryGatewayName, Namespace: infraNamespace} | ||
secondaryGatewayNN := types.NamespacedName{Name: secondaryGatewayName, Namespace: infraNamespace} | ||
|
||
t.Run("Primary HTTPRoute, InferencePool, and Gateway path: verify status and traffic", func(t *testing.T) { | ||
k8sutils.HTTPRouteAndInferencePoolMustBeAcceptedAndRouteAccepted( | ||
t, | ||
s.Client, | ||
routeForPrimaryGWNN, | ||
primaryGatewayNN, | ||
primaryPoolNN, | ||
) | ||
|
||
primaryGwAddr := k8sutils.GetGatewayEndpoint(t, s.Client, s.TimeoutConfig, primaryGatewayNN) | ||
|
||
traffic.MakeRequestAndExpectEventuallyConsistentResponse( | ||
t, | ||
s.RoundTripper, | ||
s.TimeoutConfig, | ||
primaryGwAddr, | ||
traffic.Request{ | ||
Host: primaryRouteHostname, | ||
Path: primaryRoutePath, | ||
ExpectedStatusCode: http.StatusOK, | ||
Backend: primaryBackendPodName, | ||
Namespace: appBackendNamespace, | ||
}, | ||
) | ||
}) | ||
|
||
t.Run("Secondary HTTPRoute, InferencePool, and Gateway path: verify status and traffic", func(t *testing.T) { | ||
k8sutils.HTTPRouteAndInferencePoolMustBeAcceptedAndRouteAccepted( | ||
t, | ||
s.Client, | ||
routeForSecondaryGWNN, | ||
secondaryGatewayNN, | ||
secondaryPoolNN, | ||
) | ||
|
||
secondaryGwAddr := k8sutils.GetGatewayEndpoint(t, s.Client, s.TimeoutConfig, secondaryGatewayNN) | ||
|
||
traffic.MakeRequestAndExpectEventuallyConsistentResponse( | ||
t, | ||
s.RoundTripper, | ||
s.TimeoutConfig, | ||
secondaryGwAddr, | ||
traffic.Request{ | ||
Host: secondaryRouteHostname, | ||
Path: secondaryRoutePath, | ||
ExpectedStatusCode: http.StatusOK, | ||
Backend: secondaryBackendPodName, | ||
Namespace: appBackendNamespace, | ||
}, | ||
) | ||
}) | ||
}, | ||
} |
44 changes: 44 additions & 0 deletions
44
conformance/tests/basic/httproute_multiple_gateways_different_pools.yaml
SinaChavoshi marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: route-for-primary-gateway | ||
namespace: gateway-conformance-app-backend | ||
spec: | ||
parentRefs: | ||
- kind: Gateway | ||
name: conformance-primary-gateway | ||
namespace: gateway-conformance-infra | ||
hostnames: | ||
- "primary.example.com" | ||
rules: | ||
- backendRefs: | ||
- group: inference.networking.x-k8s.io | ||
kind: InferencePool | ||
name: primary-inference-pool | ||
matches: | ||
- path: | ||
type: PathPrefix | ||
value: /test-primary-gateway | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: route-for-secondary-gateway | ||
namespace: gateway-conformance-app-backend | ||
spec: | ||
parentRefs: | ||
- kind: Gateway | ||
name: conformance-secondary-gateway | ||
namespace: gateway-conformance-infra | ||
hostnames: | ||
- "secondary.example.com" | ||
rules: | ||
- backendRefs: | ||
- group: inference.networking.x-k8s.io | ||
kind: InferencePool | ||
name: secondary-inference-pool | ||
matches: | ||
- path: | ||
type: PathPrefix | ||
value: /test-secondary-gateway |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.