Best Approach for Using Load Balancers with GKE and GCS/CDN on Google Cloud

We are working on deploying an application on Google Cloud and encountered challenges when trying to use the same load balancer for both a GKE Ingress (handling backend services) and a GCS bucket with a CDN for static content. Based on research, it seems that the GKE controller manages the load balancer when using default Ingress, and any manual changes to the load balancer could be overwritten by GKE. Additionally, creating a load balancer manually for the GCS bucket cannot be linked with GKE.

Questions:

  1. Is there any other approach that allows us to route traffic between a GKE backend and a GCS bucket with CDN using the same load balancer, or is it necessary to use two separate load balancers?

  2. If we create two different load balancers—one for the GKE app and another for the GCS bucket with CDN:

    • How can we handle the two URLs generated by the separate load balancers?
    • Which URL should be used as the main application entry point?
    • Is there a way to map one main URL that can route traffic between the GKE backend and the CDN for static content?

We appreciate any insights or suggestions for best practices in this setup!

You need two separate load balancers: one for GKE and another for the GCS bucket with CDN. Use a reverse proxy or DNS settings to map both to a single domain. The GKE app URL should be the main entry point, routing static content requests to the GCS bucket.