Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

how to use load balancer with cloud run without cloud run FQDN host in header

I have two projects in google cloud.
  • One for DNS management and load balancing.
  • The other one has cloud run services.
Now I need to use this load balancer to route to cloud run services. So I,
  • created an internet Network Endpoint Group in the load-balancer project to point to FQDN of cloud run.
  • Then created custom domain route rule to route to the created internet NEG which in turn routes to cloud run.
Now, my problem is- I can’t route it without using the host header and setting that to the FQDN of cloud run. But I depend on the actual host in my service. How to solve for that?
0 1 718
1 REPLY 1

jkg
Google Developer Expert
Google Developer Expert

What you're looking for is a serverless network endpoint group. Unfortunately, serverless negs are not shareable cross project.

It seems that you're already achieving cross project endpoint sharing via the internet neg. So in order to remove the fully qualified domain name from your neg you'll probably need to create a load balancer in the cloud run project and have your other load balancer point to it and then attach the cloud run instance via a serverless neg to that load balancer.