From 151408e40bc5a3fedded14034205f1665c0d07d4 Mon Sep 17 00:00:00 2001 From: abrennan Date: Tue, 8 Sep 2020 14:45:18 -0500 Subject: [PATCH] Fix for SRVKS-612: HTTP2 / gRPC --- ...nteracting-serverless-apps-http2-gRPC.adoc | 55 +++++++++++++------ 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/modules/interacting-serverless-apps-http2-gRPC.adoc b/modules/interacting-serverless-apps-http2-gRPC.adoc index 150692b776..91f748d98d 100644 --- a/modules/interacting-serverless-apps-http2-gRPC.adoc +++ b/modules/interacting-serverless-apps-http2-gRPC.adoc @@ -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 application’s 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 application’s 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 application’s 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. +====