OCPBUGS-42972: Support appProtocol: kubernetes.io/h2c - #627
Conversation
|
@Miciah: This pull request references Jira Issue OCPBUGS-42972, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/jira refresh |
|
@Miciah: This pull request references Jira Issue OCPBUGS-42972, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
DetailsIn 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 openshift-eng/jira-lifecycle-plugin repository. |
|
@Miciah: This pull request references Jira Issue OCPBUGS-42972, which is valid. 3 validation(s) were run on this bug
DetailsIn 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/assign @grzpiotrowski |
|
/unassign @Miciah |
|
@ShudiLi PTAL, thanks. |
|
Tested it with 4.17.0-0.ci.test-2024-10-24-012937-ci-ln-5zxwybb-latest |
|
enabled appProtocol: kubernetes.io/h2c under the unsecure service, created the edge route, then curl the route and check the packets on server side, it was http2 /label qe-approved |
|
@Miciah: This pull request references Jira Issue OCPBUGS-42972, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: DetailsIn 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 openshift-eng/jira-lifecycle-plugin repository. |
|
/label priority/backlog |
|
@Miciah: The label(s) DetailsIn 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. |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alebedev87 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
* pkg/router/router_test.go (mustCreate): Rename... (mustCreateRoute): ... to this.
* pkg/router/router_test.go (harness): Add a client field. (TestMain): Initialize the harness client field with the Kubernetes client set. (TestConfigTemplate): Add test cases where the endpointslice associated with the route specifies appProtocol with the recognized value "h2c" and unrecognized values "unknown-value" and "kubernetes.io/h2c". Verify that the recognized value causes "proto h2" to be added to the backend server line and that the unrecognized values do not. Modify the test logic to apply an optional mustCreateEndpointSlice from the test expectations. (mustCreateRoute): Add targetServiceName field. ((mustCreateRoute).Apply): Initialize the route's spec.to.name field to the targetServiceName value from the mustCreateRoute parameters if it is specified. This new parameter isn't strictly required for the new test cases, but it makes them more explicit and easier to read. (mustCreateEndpointSlice): New type, used in the new test cases. ((mustCreateEndpointSlice).Apply): Create an endpointslice using the Kubernetes API client set from the harness and the specified endpointslice name, service name, and port appProtocol value from the mustCreateEndpointSlice parameters. (mustCreateWithConfig): Add mustCreateEndpointSlice so that the new test cases can use it. (matchConfig): Add logic for parsing the "server" attribute, which the new test cases use.
This commit fixes OCPBUGS-42972. https://issues.redhat.com/browse/OCPBUGS-42972 * images/router/haproxy/conf/haproxy-config.template: * pkg/router/template/configmanager/haproxy/backend.go ((Backend).UpdateServerInfo): * pkg/router/template/configmanager/haproxy/manager.go ((haproxyConfigManager).ReplaceRouteEndpoints): Recognize both "h2c" and "kubernetes.io/h2c" as valid values for appProtocol. * pkg/router/router_test.go (TestConfigTemplate): Update the expectations for the "route with appProtocol: kubernetes.io/h2c" test case.
5a17c61 to
a405953
Compare
|
https://github.com/openshift/router/compare/5a17c618fb29df8148628327324eeef495e79a0c..a40595370fde26f1fcf4094cb8b2e21522b03686 rebases to fix a failing unit test case with the old |
|
/lgtm |
|
@Miciah: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
|
@Miciah: Jira Issue OCPBUGS-42972: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-42972 has been moved to the MODIFIED state. DetailsIn 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 openshift-eng/jira-lifecycle-plugin repository. |
|
[ART PR BUILD NOTIFIER] Distgit: ose-haproxy-router-base |
|
[ART PR BUILD NOTIFIER] Distgit: openshift-enterprise-haproxy-router |
Root cause: - HAProxy does not support HTTP/1.1 -> HTTP/2 cleartext (h2c) upgrade - HTTP/2 over plain HTTP requires Service configuration with appProtocol: kubernetes.io/h2c (see openshift/router#627) - The test framework does not support configuring Service appProtocol - s390x OpenShift cluster does not have h2c enabled by default Attempted solutions: 1. Client h2c configuration - Failed: HAProxy blocks h2c without appProtocol 2. HTTPS with ALPN - Failed: Causes Keycloak container startup issues The test is disabled with @disabled annotation and clear documentation of the limitation until either: - Test framework adds support for Service appProtocol configuration - s390x cluster is configured to support h2c by default - Or we find a way to configure this via application properties This allows the other tests in the suite to pass while documenting the known limitation for this specific scenario. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…support This implements Approach B - pre-creating a Service template with the correct appProtocol configuration to enable h2c (HTTP/2 over plain HTTP) on OpenShift. Changes: 1. Added quarkus-openshift extension to pom.xml - Enables Kubernetes/OpenShift resource generation - Allows custom resource templates to be merged 2. Created src/main/kubernetes/openshift.yml - Defines Service with appProtocol: kubernetes.io/h2c - This tells OpenShift HAProxy to use "proto h2" for backend connections - Required because HAProxy doesn't support HTTP Upgrade to h2c 3. Enabled OpenShift resource generation in application.properties - Added quarkus.kubernetes.deployment-target=openshift - Quarkus will now generate and merge OpenShift resources 4. Re-enabled http2Server test with h2c client configuration - Removed @disabled annotation - Added h2c WebClientOptions (HTTP_2 protocol, SSL=false) - Added documentation explaining the appProtocol requirement How it works: - Quarkus OpenShift extension reads src/main/kubernetes/openshift.yml - Merges it with auto-generated resources during build - Deployed Service includes appProtocol: kubernetes.io/h2c - OpenShift router configures HAProxy with "proto h2" for this service - Client can now successfully negotiate HTTP/2 over plain HTTP This should work on all architectures (s390x, x86_64, ppc64le) since OpenShift router v4.x supports appProtocol h2c configuration. Reference: openshift/router#627 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Rename
mustCreatetomustCreateRouteRename the
mustCreatetype used in tests tomustCreateRoute.Add test cases for
appProtocolDefine a new
mustCreateEndpointSlicetype for tests, and use it to define new test cases where the endpointslice associated with the route specifiesappProtocolwith the recognized value "h2c" and unrecognized values "unknown-value" and "kubernetes.io/h2c".Support
appProtocol: kubernetes.io/h2cRecognize both "h2c" and "kubernetes.io/h2c" as valid values for
appProtocol. Update the expectations for the "route with appProtocol: kubernetes.io/h2c" test case accordingly.Follow-up to #328.