1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 21:46:22 +01:00

Merge pull request #25742 from openshift-cherrypick-robot/cherry-pick-25337-to-enterprise-4.6

[enterprise-4.6] Fix for SRVKS-612: HTTP2 / gRPC
This commit is contained in:
Bob Furu
2020-09-23 15:07:07 -04:00
committed by GitHub

View File

@@ -3,51 +3,64 @@
// * serverless/serving-creating-managing-apps.adoc
[id="interacting-serverless-apps-http2-gRPC_{context}"]
= Interacting with a serverless application using HTTP2 / gRPC
= Interacting with a serverless application using HTTP2 and gRPC
{ServerlessProductName} supports only insecure or edge-terminated routes.
Insecure or edge-terminated routes do not support HTTP2 on {product-title}.
These routes also do not support gRPC because gRPC is transported by HTTP2.
{product-title} routes do not support HTTP2, and therefore do not support gRPC as this is transported by HTTP2.
If you use these protocols in your application, you must call the application using the ingress gateway directly.
To do this you must find the ingress gateway's public address and the application's specific host.
.Procedure
. Find the application host. See the instructions in _Verifying your serverless application deployment_.
. The ingress gateway's public address can be determined using this command:
. Find the ingress gateway's public address:
+
[source,terminal]
----
$ oc -n knative-serving-ingress get svc kourier
----
+
The output will be similar to this example:
.Example output:
+
[source,terminal]
----
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kourier LoadBalancer 172.30.51.103 a83e86291bcdd11e993af02b7a65e514-33544245.us-east-1.elb.amazonaws.com 80:31380/TCP,443:31390/TCP 67m
----
+
The public address is surfaced in the `EXTERNAL-IP` field, and in this case would be:
+
----
a83e86291bcdd11e993af02b7a65e514-33544245.us-east-1.elb.amazonaws.com
----
The public address is surfaced in the `EXTERNAL-IP` field.
In this case, it would be `a83e86291bcdd11e993af02b7a65e514-33544245.us-east-1.elb.amazonaws.com`.
. Manually set the host header of your HTTP request to the applications host, but direct the request itself against the public address of the ingress gateway.
+
Here is an example, using the information obtained from the steps in _Verifying your serverless application deployment_:
The following example uses the information obtained from the steps in _Verifying your serverless application deployment_:
+
.Example command
[source,terminal]
----
$ curl -H "Host: hello-default.example.com" a83e86291bcdd11e993af02b7a65e514-33544245.us-east-1.elb.amazonaws.com
----
+
.Example output
[source,terminal]
----
Hello Serverless!
----
+
You can also make a gRPC request by setting the authority to the applications host, while directing the request against the ingress gateway directly.
+
Here is an example of what that looks like in the Golang gRPC client:
+
[NOTE]
====
Ensure that you append the respective port (80 by default) to both hosts as shown in the example.
====
You can also make a gRPC request by setting the authority to the applications host, while directing the request against the ingress gateway directly:
+
[source,yaml]
----
grpc.Dial(
"a83e86291bcdd11e993af02b7a65e514-33544245.us-east-1.elb.amazonaws.com:80",
@@ -55,3 +68,9 @@ grpc.Dial(
grpc.WithInsecure(),
)
----
+
[NOTE]
====
Ensure that you append the respective port, 80 by default, to both hosts as shown in the previous example.
====