0

I am using Nginx-Ingress Controller on my GKE cluster. The nginx version is 1.23.2

  • I doubt that nginx supports forwarding http2. Last time I checked, it did not have plans for supporting it. – Jonas Nov 16 '22 at 17:25

1 Answers1

0

GKE has an option Using HTTP/2 for load balancing with Ingress :

The connection from the load balancer proxy to your application uses HTTP/1.1 by default. If your application, running in a Google Kubernetes Engine (GKE) pod, is capable of receiving HTTP/2 requests, you configure the external load balancer to use HTTP/2 when it forwards requests to your application.This feature has some HTTP/2 limitations read before you begin.

For achieving this you need to create a Deployment, a Service, and an Ingress. You need to put a cloud.google.com/app-protocols annotation in your Service manifest to specify that the load balancer should use HTTP/2 to communicate with your application.

As mentioned above while creating service add cloud.google.com/app-protocols: '{"my-port":"HTTP2"}' , so that the cloud.google.com/app-protocols annotation specifies that my-port should use the HTTP/2 protocol.

Here is the Official doc which has yaml files and procedure for using HTTP/2 protocol.

Sai Chandra Gadde
  • 2,242
  • 1
  • 3
  • 15
  • I am not sure if this will work with Nginx-Ingress Controller. I am not using GCE ingress for my applications. – Satyam Bhatia Nov 16 '22 at 13:11
  • Here is a similar [stack question](https://stackoverflow.com/questions/67471377/using-http-2-with-nginx-ingress-on-gke), can you try it and let me know if it works. – Sai Chandra Gadde Nov 17 '22 at 06:24
  • I tried updating my nginx-ingress controller by providing both in its configmap, still my domains aren't using `http2` protocol. `use-http2: "true"` `http2: "true"` – Satyam Bhatia Nov 17 '22 at 07:30