-
Couldn't load subscription status.
- Fork 132
Add documentation for Request Routing in Kmesh (L7 capability) #1469
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?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
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.
Summary of Changes
Hello @AkarshSahlot, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
I've added comprehensive documentation for Layer 7 (L7) request routing in Kmesh. This new guide focuses on path-based routing, providing a clear, step-by-step example using Gateway API and httpbin services. The goal is to help users understand and implement L7 routing, laying the groundwork for future documentation on advanced L7 features.
Highlights
- New Documentation File: A new file, docs/l7/request-routing.md, has been added to the Kmesh developer documentation.
- L7 Request Routing Overview: The document provides an introduction and overview of Layer 7 (L7) request routing in Kmesh.
- Detailed Example for Path-Based Routing: A step-by-step example demonstrates path-based routing, showing how to direct traffic to different httpbin service versions based on URL path prefixes (/v1 and /v2).
- Gateway API Configuration Example: The documentation includes the YAML configuration for an HTTPRoute resource, illustrating how to set up multiple match rules for path-based routing using Gateway API.
- Verification Steps: Clear instructions are provided for verifying the routing configuration, including curl commands to be executed from a sleep pod.
- Prerequisites and Limitations: The document outlines necessary prerequisites for setting up L7 routing and notes known limitations, such as header-based and regex path matching requiring further validation.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments or fill out our survey to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Paths diverge and meet,Traffic flows, a guided stream,Docs light the way home.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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.
Code Review
This pull request adds valuable documentation for L7 request routing in Kmesh. The example is clear and helpful. I've found a critical issue in the provided YAML configuration that would prevent it from working, and I've also suggested some changes to make the example self-contained and easier for users to follow. My feedback focuses on ensuring the documentation is accurate and immediately usable.
| ```yaml | ||
| apiVersion: gateway.networking.k8s.io/v1beta1 | ||
| kind: HTTPRoute | ||
| meta |
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.
| parentRefs: | ||
| - name: example-gateway |
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.
The example relies on an example-gateway which is not defined in this document. This makes the example incomplete and hard for users to follow. For demonstrating mesh request routing, it's more common and clearer to attach the HTTPRoute to a Service.
I suggest the following changes to make the example self-contained:
-
In Step 1, create a virtual
httpbinservice that will act as the parent for the route. You can add instructions to create a file (e.g.,httpbin-service.yaml) with the following content and apply it:apiVersion: v1 kind: Service metadata: name: httpbin namespace: example spec: ports: - port: 8000 name: http selector: # This service has no pods, it's just a handle for the HTTPRoute. app: non-existent
-
In Step 2, update the
HTTPRouteto reference this new service as its parent, as suggested below.
| parentRefs: | |
| - name: example-gateway | |
| parentRefs: | |
| - name: httpbin | |
| kind: Service | |
| port: 8000 |
|
|
||
| ## Notes and Limitations | ||
|
|
||
| Header-based and regex path matching may require further validation. These instructions assume the example-gateway resource is present and working as expected. |
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.
| @@ -0,0 +1,93 @@ | |||
|
|
|||
| # Request Routing in Kmesh | |||
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.
Looks like we already have this doc, ref: https://kmesh.net/docs/application-layer/try-request-routing
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.
Thank you for pointing that out! Yes, I noticed the existing documentation and my PR focuses on testing or demonstrating the process specifically on the macOS platform. I wanted to share my experience to help macOS users better follow the steps.
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.
@AkarshSahlot If this is for macos, i am not sure kmesh works. If it can work on mac os. Can you please update the install guide rather than for each task
This PR contributes documentation for Issue #600, expanding the official Kmesh developer documentation with an example of Layer 7 (L7) request routing.
Included in this PR:
• A new file: docs/l7/request-routing.md
• Introduction and overview of L7 request routing in Kmesh
• Step-by-step example using Gateway API and httpbin-v1/httpbin-v2 services
• YAML config for HTTPRoute with multiple match rules
• Verification steps using curl from the sleep pod
• Notes on prerequisites and known limitations
• Related references for Kmesh and Istio documentation
The goal is to help users understand and experiment with L7 routing based on path prefixes, and to build a foundation for future docs on additional L7 features (timeouts, traffic shifting, etc.).
Please let me know if the structure or example should be adjusted. Happy to follow up with more L7 feature docs in subsequent PRs.
Fixes #600