-
Notifications
You must be signed in to change notification settings - Fork 581
Add GRPCRoute weighted backendRefs test #3962
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
base: main
Are you sure you want to change the base?
Add GRPCRoute weighted backendRefs test #3962
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sarthyparty The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @sarthyparty! |
Hi @sarthyparty. 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 Once the patch is verified, the new status will be reflected by the 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. |
Question for the maintainers, since |
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also add the tests in conformance/tests/mesh/
Good question. I think this is a core feature of GRPCRoute, meaning everyone who supports GRPCRoute is expected to support this. You are right that we did not have conformance for that (which is sub-optimal) but the implementors of this should have already supported this feature. So I think adding coverage is good, and if we break someone - thats a good sign they should fix it, cause the promise we give to our users is that weights are supported with grpcRoute /cc @mikemorris @robscott for thoughts |
@LiorLieberman: GitHub didn't allow me to request PR reviews from the following users: for, thoughts. Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
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. |
Yes, agreed that weighted load-balancing is a Core feature, meaning that support is not optional. So if we break existing implementations, they'll need to fix it before they can claim support for the release this is included in (that is, v1.4). |
/retest |
@sarthyparty ping on this in case you missed that part of the comment |
Oh shoot thanks for ping I missed it. Also I'll fix the lint issue |
41fa6c3
to
bef25ff
Compare
@LiorLieberman Do you want me to add gRPC mesh setup for testing? There doesn't seem to be any GRPC tests there. Or did you just mean to refactor the existing http weight test to use the shared func? |
I dont think you need any special setup beyond what we already have in mesh base manifests for conformance. (feel free to shout if I am missing something here). I did mean to add grpc test to this folder as well, so it adds mesh coverage for that. |
/retest |
Haven't ran the mesh test on an implementation yet |
I've tested it with istio, httproute-weight works. grpcRoute test is skipped, due to my above comment. If you want to run it - you can use the below command from your branch
(assuming you have istio installed) |
/retest |
I just tested the GRPC weight test on istio and it worked |
thanks, mind sharing the command and logs you've run? in my local env it fails. |
Oh weird, I ran it again and it failed. Gonna look at this again |
I'm not sure how the cleanup makes a difference, but when I ran the command you gave without the cleanup flag set to false, it passed.
|
can you paste the logs? it looks like with the changes you made, it is now doing http and not grpc |
expected := http.ExpectedResponse{ | ||
Request: http.Request{Protocol: "grpc", Path: "", Host: "echo:7070"}, | ||
Response: http.Response{StatusCode: 200}, | ||
Namespace: "gateway-conformance-mesh", | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like it is now doing http..? there is no sendGRPC stuff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my understand the way that the mesh http route weight test is working is by execing into the pod and running a command client http://echo:7070
. Using the grpc package doesn't work, since I need to run the request from the pod I think?
I was able to configure this by just setting the protocol to grpc in the http Request structure. I think the correct way to do this is probably to refactor the echo client code to accept a structure that is independent of protocol.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
req := m.rc.Post().
Resource("pods").
Name(m.Name).
Namespace(m.Namespace).
SubResource("exec").
Param("container", container).
VersionedParams(&v1.PodExecOptions{
Container: container,
Command: args,
Stdin: false,
Stdout: true,
Stderr: true,
TTY: false,
}, scheme.ParameterCodec)
This code here utils/echo/pod.go L168, with args being ['client', 'http://echo:7070'] for http. By setting the protocol to grpc it becomes ['client', 'grpc://echo:7070'] which makes a grpc request I believe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I will refactor the echo pod function CaptureRequestResponseAndCompare
to accept a structure that is protocol independent since it doesn't need to be http specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually its a lot more code change than I thought to refactor that, what do you think
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is istio client code
/cc @howardjohn can you relate to this?
|
See my other comment, it looks like you are sending http and not grpc now |
/cc @howardjohn |
What type of PR is this?
/kind test
What this PR does / why we need it:
Adds GRPCRoute weighted BackendRefs test. Increase conformance feature coverage of GRPCRoute
Which issue(s) this PR fixes:
Fixes #2901
Does this PR introduce a user-facing change?: