-
Notifications
You must be signed in to change notification settings - Fork 164
[TT-10496] extra docs for gRPC high availability #6462
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: master
Are you sure you want to change the base?
Conversation
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
✅ PS. Add to the end of url /docs/nightly
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Questions:
- Does our gRPC client enable health checking, as shown in this example?
No, currently we don't support that but I guess we could in the future. |
@@ -378,5 +378,259 @@ In the above code, the `NewFuncWithError` function demonstrates error handling i | |||
{{< img src="/img/plugins/span_error_handling.png" alt="OTel Span error handling" >}} | |||
|
|||
|
|||
## Highly Available gRPC Servers in Kubernetes | |||
|
|||
When deploying gRPC servers as Tyk Gateway coprocess middlewares in Kubernetes, implementing proper health checks is crucial for achieving high availability and enabling seamless rolling updates. Not having them could lead to situations in which your calls that are going through Tyk erroring out due to the gRPC client being unable to connect and correctly execute the coprocessing middleware. |
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.
When deploying gRPC servers as Tyk Gateway coprocess middlewares in Kubernetes, implementing proper health checks is crucial for achieving high availability and enabling seamless rolling updates. Not having them could lead to situations in which your calls that are going through Tyk erroring out due to the gRPC client being unable to connect and correctly execute the coprocessing middleware. | |
When deploying gRPC servers to host [rich plugins]({{< ref "api-management/plugins/rich-plugins#using-grpc" >}}) in Kubernetes, implementing proper health checks is crucial so that you can achieve high availability and enable seamless rolling updates. If Tyk is unable to reach the gRPC server, then it will be unable to correctly execute the plugins, leading to API requests failing. |
- Failed pods won't be automatically restarted | ||
- Load balancing becomes unreliable | ||
|
||
For Tyk Gateway coprocess middlewares, this is especially important since the gateway depends on these gRPC services to process requests. |
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.
For Tyk Gateway coprocess middlewares, this is especially important since the gateway depends on these gRPC services to process requests. | |
For Tyk Gateway rich plugins this is especially important since the Gateway depends on these gRPC services to process requests. |
|
||
### gRPC Health Checking Protocol | ||
|
||
The modified example uses the [gRPC Health Checking Protocol](https://github.com/grpc/grpc/blob/master/doc/health-checking.md) instead of HTTP endpoints. This approach offers several advantages: |
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.
What do you mean by "modified" example? Is this the example above? Modified from what reference?
|
||
For Tyk Gateway coprocess middlewares, this is especially important since the gateway depends on these gRPC services to process requests. | ||
|
||
### Implementation |
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.
Please can you add something here to explain what you are implementing and where this should be hosted?
3. **Better Resource Utilization**: No need for separate HTTP server | ||
4. **Consistent Protocol**: Maintains gRPC throughout the stack | ||
|
||
#### Health Check Implementation Details |
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.
Is this the description for the preceding code? If so, please can you bring it together? I suggest moving the "benefits of gRPC Health Probes" section under "Why health probes matter"
- **Shutdown**: `SERVING` → `NOT_SERVING` (immediate) | ||
- **Error**: `SERVING` → `NOT_SERVING` (on failure) | ||
|
||
#### Required Dependencies |
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.
Is this part of the preceding "Implementation"?
|
||
The health checking service is included in the standard gRPC Go library. | ||
|
||
### Key Benefits for Rolling Updates |
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 section should also sit in the descriptive part, before the example.
- Startup probes give adequate time for slow-starting services | ||
- Failed deployments are automatically rolled back | ||
|
||
### How to do load balancing |
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.
### How to do load balancing | |
### Load balancing between multiple gRPC servers |
ListenAddress = ":50051" | ||
) | ||
|
||
func main() { |
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.
@andyo-tyk is this tested?
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 was originally @andrei-tyk's content - I just restructured, so I believe it will be correct.
User description
Added extra docs around gRPC high availability and DNS protocol for gRPC.
Preview Link
Checklist
New Contributors
master
.PR Type
Documentation
Description
Added detailed documentation on highly available gRPC servers in Kubernetes
Provided Go example for health checks and graceful shutdown
Included Kubernetes deployment YAML with probes for gRPC middleware
Documented DNS-based load balancing for gRPC in Tyk 5.8.2+
Changes walkthrough 📝
advance-config.md
Add gRPC high availability and DNS protocol documentation
tyk-docs/content/api-management/plugins/advance-config.md
servers in Kubernetes
shutdown
probes