Skip to content

Commit 6013c48

Browse files
authored
Merge pull request #87145 from dfitzmau/OSDOCS-12906
OSDOCS-12906: Linked HTTP/2 doc in route config guide
2 parents 9603bd3 + d68b00d commit 6013c48

File tree

5 files changed

+29
-20
lines changed

5 files changed

+29
-20
lines changed

modules/nw-creating-a-route.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[id="nw-creating-a-route_{context}"]
77
= Creating an HTTP-based route
88

9-
A route allows you to host your application at a public URL. It can either be secure or unsecured, depending on the network security configuration of your application. An HTTP-based route is an unsecured route that uses the basic HTTP routing protocol and exposes a service on an unsecured application port.
9+
Create a route to host your application at a public URL. The route can either be secure or unsecured, depending on the network security configuration of your application. An HTTP-based route is an unsecured route that uses the basic HTTP routing protocol and exposes a service on an unsecured application port.
1010

1111
The following procedure describes how to create a simple HTTP-based route to a web application, using the `hello-openshift` application as an example.
1212
//link:https://github.com/openshift/origin/tree/master/examples/hello-openshift[hello-openshift]

modules/nw-enabling-hsts-per-route.adoc

+5-9
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,14 @@ endif::microshift[]
1919

2020
.Procedure
2121

22-
* To enable HSTS on a route, add the `haproxy.router.openshift.io/hsts_header` value to the edge-terminated or re-encrypt route. You can use the `oc annotate` tool to do this by running the following command:
22+
* To enable HSTS on a route, add the `haproxy.router.openshift.io/hsts_header` value to the edge-terminated or re-encrypt route. You can use the `oc annotate` tool to do this by running the following command. To properly run the command, ensure that the semicolon (`;`) in the `haproxy.router.openshift.io/hsts_header` route annotation is also surrounded by double quotation marks (`""`).
2323
+
24+
.Example `annotate` command that sets the maximum age to `31536000` ms (approximetly 8.5 hours)
2425
[source,terminal]
2526
----
26-
$ oc annotate route <route_name> -n <namespace> --overwrite=true "haproxy.router.openshift.io/hsts_header"="max-age=31536000;\ <1>
27+
$ oc annotate route <route_name> -n <namespace> --overwrite=true "haproxy.router.openshift.io/hsts_header=max-age=31536000;\
2728
includeSubDomains;preload"
2829
----
29-
<1> In this example, the maximum age is set to `31536000` ms, which is approximately 8.5 hours.
30-
+
31-
[NOTE]
32-
====
33-
In this example, the equal sign (`=`) is in quotes. This is required to properly execute the annotate command.
34-
====
3530
+
3631
.Example route configured with an annotation
3732
[source,yaml]
@@ -41,13 +36,14 @@ kind: Route
4136
metadata:
4237
annotations:
4338
haproxy.router.openshift.io/hsts_header: max-age=31536000;includeSubDomains;preload <1> <2> <3>
44-
...
39+
# ...
4540
spec:
4641
host: def.abc.com
4742
tls:
4843
termination: "reencrypt"
4944
...
5045
wildcardPolicy: "Subdomain"
46+
# ...
5147
----
5248
<1> Required. `max-age` measures the length of time, in seconds, that the HSTS policy is in effect. If set to `0`, it negates the policy.
5349
<2> Optional. When included, `includeSubDomains` tells the client

modules/nw-http2-haproxy.adoc

+17-10
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,31 @@
22
//
33
// * networking/ingress-operator.adoc
44

5-
:_mod-docs-content-type: PROCEDURE
5+
:_mod-docs-content-type: CONCEPT
66
[id="nw-http2-haproxy_{context}"]
7-
= Enabling and disabling HTTP/2 on Ingress Controllers
7+
= Enable or disable HTTP/2 on Ingress Controllers
88

9-
You can enable or disable transparent end-to-end HTTP/2 connectivity in HAProxy. This allows application owners to make use of HTTP/2 protocol capabilities, including single connection, header compression, binary streams, and more.
9+
You can enable or disable transparent end-to-end HTTP/2 connectivity in HAProxy. Application owners can use HTTP/2 protocol capabilities, including single connection, header compression, binary streams, and more.
1010

1111
You can enable or disable HTTP/2 connectivity for an individual Ingress Controller or for the entire cluster.
1212

13-
To enable the use of HTTP/2 for the connection from the client to HAProxy, a route must specify a custom certificate. A route that uses the default certificate cannot use HTTP/2. This restriction is necessary to avoid problems from connection coalescing, where the client re-uses a connection for different routes that use the same certificate.
14-
15-
The connection from HAProxy to the application pod can use HTTP/2 only for re-encrypt routes and not for edge-terminated or insecure routes. This restriction is because HAProxy uses Application-Level Protocol Negotiation (ALPN), which is a TLS extension, to negotiate the use of HTTP/2 with the back-end. The implication is that end-to-end HTTP/2 is possible with passthrough and re-encrypt and not with edge-terminated routes.
16-
1713
[NOTE]
1814
====
19-
You can use HTTP/2 with an insecure route whether the Ingress Controller has HTTP/2 enabled or disabled.
15+
If you enable or disable HTTP/2 connectivity for an individual Ingress Controller and for the entire cluster, the HTTP/2 configuration for the Ingress Controller takes precedence over the HTTP/2 configuration for the cluster.
2016
====
2117

18+
To enable the use of HTTP/2 for a connection from the client to an HAProxy instance, a route must specify a custom certificate. A route that uses the default certificate cannot use HTTP/2. This restriction is necessary to avoid problems from connection coalescing, where the client re-uses a connection for different routes that use the same certificate.
19+
20+
Consider the following use cases for an HTTP/2 connection for each route type:
21+
22+
* For a re-encrypt route, the connection from HAProxy to the application pod can use HTTP/2 if the application supports using Application-Level Protocol Negotiation (ALPN) to negotiate HTTP/2 with HAProxy. You cannot use HTTP/2 with a re-encrypt route unless the Ingress Controller has HTTP/2 enabled.
23+
* For a passthrough route, the connection can use HTTP/2 if the application supports using ALPN to negotiate HTTP/2 with the client. You can use HTTP/2 with a passthrough route if the Ingress Controller has HTTP/2 enabled or disabled.
24+
* For an edge-terminated secure route, the connection uses HTTP/2 if the service specifies only `appProtocol: kubernetes.io/h2c`. You can use HTTP/2 with an edge-terminated secure route if the Ingress Controller has HTTP/2 enabled or disabled.
25+
* For an insecure route, the connection uses HTTP/2 if the service specifies only `appProtocol: kubernetes.io/h2c`. You can use HTTP/2 with an insecure route if the Ingress Controller has HTTP/2 enabled or disabled.
26+
2227
[IMPORTANT]
2328
====
24-
For non-passthrough routes, the Ingress Controller negotiates its connection to the application independently of the connection from the client. This means a client may connect to the Ingress Controller and negotiate HTTP/1.1, and the Ingress Controller might then connect to the application, negotiate HTTP/2, and forward the request from the client HTTP/1.1 connection using the HTTP/2 connection to the application. This poses a problem if the client subsequently tries to upgrade its connection from HTTP/1.1 to the WebSocket protocol, because the Ingress Controller cannot forward WebSocket to HTTP/2 and cannot upgrade its HTTP/2 connection to WebSocket. Consequently, if you have an application that is intended to accept WebSocket connections, it must not allow negotiating the HTTP/2 protocol or else clients will fail to upgrade to the WebSocket protocol.
25-
====
29+
For non-passthrough routes, the Ingress Controller negotiates its connection to the application independently of the connection from the client. This means a client might connect to the Ingress Controller and negotiate HTTP/1.1. The Ingress Controller might then connect to the application, negotiate HTTP/2, and forward the request from the client HTTP/1.1 connection by using the HTTP/2 connection to the application.
30+
31+
This sequence of events causes an issue if the client subsequently tries to upgrade its connection from HTTP/1.1 to the WebSocket protocol. Consider that if you have an application that is intending to accept WebSocket connections, and the application attempts to allow for HTTP/2 protocol negotiation, the client fails any attempt to upgrade to the WebSocket protocol.
32+
====

networking/networking_operators/ingress-operator.adoc

+1
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ include::modules/nw-ingress-set-or-delete-http-headers.adoc[leveloffset=+2]
9797

9898
include::modules/nw-using-ingress-forwarded.adoc[leveloffset=+2]
9999

100+
// Enable or disable HTTP/2 on Ingress Controllers
100101
include::modules/nw-http2-haproxy.adoc[leveloffset=+2]
101102

102103
include::modules/nw-enable-http2.adoc[leveloffset=+3]

networking/routes/route-configuration.adoc

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ include::modules/nw-enabling-hsts.adoc[leveloffset=+1]
2626
//Enabling HTTP strict transport security per-route
2727
include::modules/nw-enabling-hsts-per-route.adoc[leveloffset=+2]
2828

29+
[role="_additional-resources"]
30+
.Additional resources
31+
32+
* xref:../../networking/networking_operators/ingress-operator.adoc#nw-http2-haproxy_configuring-ingress[Enabling HTTP/2 Ingress connectivity]
33+
2934
//Disabling HTTP strict transport security per-route
3035
include::modules/nw-disabling-hsts.adoc[leveloffset=+2]
3136

0 commit comments

Comments
 (0)