chart(add): Default ingress annotations for upstream keepalive, or disable HTTP/2 #2328
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.
User description
Thanks for contributing to the Docker-Selenium project!
A PR well described will help maintainers to quickly review and merge it
Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.
Description
Ingress Configuration
List mapping of chart values and default annotation(s)
Motivation and Context
TLS termination in the ingress controller, HTTP/2, and related troubleshooting
In case the Selenium Grid is deployed with the Ingress controller in front, and the Ingress controller has configured the secure connection with approach SSL termination to terminate the TLS connection, the backend components (mostly Hub/Router to process the request and return to the client) will receive the incoming in plain HTTP. In a few confirmations (also referred to ChatGPT)
At that time, the Selenium Grid server returns the response in HTTP/1.1. However, this mismatch is not expected to cause any problems. Selenium Grid is using JDKHttpClient to communicate between components since the following OpenJDK docs mentioned that
A few reports mention the error
java.io.IOException: HTTP/1.1 header parser received no bytes
,java.io.IOException: /: GOAWAY received
, or a timed-out issue with a stack trace containingjdk.internal.net.http.Http2Connection
, orHttp2ClientImpl
when creating a RemoteWebDriver session.What could be the issue around this? It could be due to different JDK versions used. Since JDK20, the default keepalive timeout has been adjusted; see docs on
jdk.httpclient.keepalive.timeout
(default to 30). Or it could bejdk.httpclient.maxstreams
(default to 100) if Grid serves many client requests at the same time, it could reach the maximum stream limit.In some scenarios, the issue might be resolved by setting ClientConfig with HTTP/1.1 when creating RemoteWebDriver. For example, in Java binding you can try this:
With the workaround set http version via ClientConfig also there was a point mentioned that we can understand something like
HTTP/1.1 header parser received no bytes
, orGOAWAY
is an IOException thrown by client HTTP/2, and when switching client to HTTP/1.1, it could go to a situation that would continue to get "random" IOExceptions with a different message from the server.For example, in this case the issue could be due to HTTP/2 configs on Ingress controller. Refer to usage of Annotations ConfigMap settings in NGINX Ingress Controller.
use-http2
(default is true) - enable or disable HTTP/2 support in secure connection.upstream-keepalive-timeout
(default to 60) - timeout during which an idle keepalive connection to an upstream server will stay open.upstream-keepalive-connections
(default to 320) - maximum number of idle keepalive connections to upstream servers. When this number is exceeded, the least recently used connections are closedThe above notes are motivated by SeleniumHQ/selenium#14258. Kindly let us know if you have further troubleshooting on this.
Types of changes
Checklist
PR Type
Enhancement, Documentation
Description
Changes walkthrough 📝
chart_test.sh
Add condition to disable HTTP/2 in ingress tests
tests/charts/make/chart_test.sh
useHttp2
setting._helpers.tpl
Add annotations for HTTP/2 and upstream keepalive settings
charts/selenium-grid/templates/_helpers.tpl
Makefile
Update test target to disable HTTP/2 in secure ingress
Makefile
values.yaml
Add HTTP/2 and upstream keepalive settings to values.yaml
charts/selenium-grid/values.yaml
useHttp2
setting for ingress.upstreamKeepalive
settings for ingress.SE_JAVA_OPTS
with HTTP client settings.README.md
Document HTTP/2 and upstream keepalive settings
charts/selenium-grid/README.md