feat: Add grpc timeouts annotations (#11258)

*  feat: add grpc timeouts with proxy settings if backend is grpc

* 📝  docs: Documentation only changes

* 🐛 fix: uppercase for protocol

* 📝 docs: grpc timeouts example

* 📝 docs: add links and default values for proxy timeout

* 🧪 test: add e2e test for timeout

* 🐛 fix: upgrade to 1.0.6 to fix nil pointer

* 🐛 fix: lint

* 🧪 test: trigger ci
This commit is contained in:
Anddd7 2024-05-27 00:37:11 +08:00 committed by GitHub
parent 3b1908e206
commit d0e9934789
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 224 additions and 7 deletions

View file

@ -1481,6 +1481,13 @@ stream {
proxy_next_upstream_timeout {{ $location.Proxy.NextUpstreamTimeout }};
proxy_next_upstream_tries {{ $location.Proxy.NextUpstreamTries }};
{{ if or (eq $location.BackendProtocol "GRPC") (eq $location.BackendProtocol "GRPCS") }}
# Grpc settings
grpc_connect_timeout {{ $location.Proxy.ConnectTimeout }}s;
grpc_send_timeout {{ $location.Proxy.SendTimeout }}s;
grpc_read_timeout {{ $location.Proxy.ReadTimeout }}s;
{{ end }}
{{/* Add any additional configuration defined */}}
{{ $location.ConfigurationSnippet }}