Is it possible to create an Ingress resource on a GKE cluster and force it to use an existing HTTP(S) load balancer?

10/7/2019

I am trying to deploy my infra on GCE and I host UI using GCP Storage Buckets and Backend APIs using a GKE cluster. I already deployed my front-end apps and added a load balancer to route requests to the UI bucket. I would like to use the same load balancer for the API traffic as well. I am wondering if it is possible to use one single load balancer for both workloads. When I create an Ingress resource on a GKE cluster, a new HTTP(S) load balancer gets automatically created as explained in this tutorial. Is it possible to create an Ingress rule which only adds a HTTP rule to an existing load balancer but does not create a new load balancer?

-- Swarup Donepudi
google-cloud-platform
kubernetes
kubernetes-ingress

1 Answer

10/7/2019

You can expose your service to a NodePort (Change the type LoadBalancer to NodePort)

Then, you can create a new backend in your loadbalancer, select your Instance Group (your node pool), and set the correct port.

It should work.

-- guillaume blaquiere
Source: StackOverflow