We have configured a cluster on GKE and installed nginx-ingress. Using our ingress rule it works, but I can't make it work with HTTP/2. We set the data information on the ConfigMap but it will always fallback to http/1.1. This exact setup was running fine on DigitalOcean. Can anyone provide some guidance?
Thanks
Install Nginx-Ingress
kubectl create ns ingress-nginx
helm repo add nginx-stable https://helm.nginx.com/stable
helm repo update
helm install nginx-ingress nginx-stable/nginx-ingress --namespace ingress-nginx
My Ingress file:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-ingress
  annotations:
    kubernetes.io/ingress.class: nginx
    kubernetes.io/ingress.global-static-ip-name: "mylocalip"
spec:
  rules:
  - host: test.mydomain.com
    http:
      paths:
      - path: /hello
        backend:
          serviceName: hello-server
          servicePort: 80
      - backend:
          serviceName: default-server
          servicePort: 80
My ConfigMap data applied to nginx-ingress-nginx-ingress configmap
data:
  use-http2: "true"
EDIT (05/11/2021):
We changed the ingress to work with certificates, now we connect using HTTPS. But still, all connections are established using http/1.1
Hi, thanks for the reply. But I've changed my ingress to use cert-manager and LetEncrypt, below is the updated Ingress.
INGRESS
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-ingress
  namespace: mynamespace
  annotations:
    kubernetes.io/ingress.class: nginx
    kubernetes.io/ingress.global-static-ip-name: "myip"
spec:
  tls:
  - hosts:
    - test.mydomain.com
    secretName: my-cert
  rules:
  - host: test.mydomain.com
    http:
      paths:
      - backend:
          serviceName: myweb
          servicePort: 80
EDIT 2 (05/14/2021)
Current version: 1.19.9-gke.1400 Test using curl and https://http2.pro/ (both indicate it's not available)
This same setup works using k8s on DigitalOcean.
Here are my install and config files:
INSTALL INGRESS-NGINX
kubectl create ns ingress-nginx
helm repo add nginx-stable https://helm.nginx.com/stable
helm repo update
helm install nginx-ingress nginx-stable/nginx-ingress --namespace ingress-nginx --set controller.service.loadBalancerIP=x.x.x.x
INGRESS
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: my-ingress
  namespace: mynamespace
  annotations:
    kubernetes.io/ingress.class: nginx
spec:
  tls:
  - hosts:
    - test.mydomain.com
    secretName: my-cert
  rules:
  - host: test.mydomain.com
    http:
      paths:
      - backend:
          serviceName: myweb
          servicePort: 80
CONFIGMAP
apiVersion: v1
kind: ConfigMap
metadata:
  namespace: ingress-nginx
  name: nginx-ingress-nginx-ingress
data:
  proxy-buffering: "false"
  ssl-ciphers: EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA256:EECDH+ECDSA+SHA384:EECDH+ECDSA+SHA256:EECDH+aRSA+SHA384:EDH+aRSA+AESGCM:EDH+aRSA+SHA256:EDH+aRSA:EECDH:!aNULL:!eNULL:!MEDIUM:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!SEED
  ssl-protocols: TLSv1.2 TLSv1.3
  ssl-redirect: "true"
  use-forward-headers: "true"
  use-http2: "true"