I have few projects in GCP using a shared VPC. e.g.
project-shared
project1-api
project2-api
project-shared has managed services such as databases etc which are used by project1 / project2. Project1 and Project2 have VMs which expose APIs.
I want to create a single load balancer in project-shared that can be used to route to project1-api or project2-api vms using different paths. I tried creating the instance group in project shared but I could not see the project1/2-api VMs listed. I then tried to the create the instance groups in the individual projects but then could not see the instance groups when I tried to create the backend service in the project-shared.
I would prefer to have single load balancer, is this possible or would I have to create one per project.
The best set-up would be 3 load balancers, one in each project so that you can leverage the load balancer's ability to hide your resources behind a single ip-address. You can create one load balancer in project-shared which will direct traffic to ip address of load balancer in project 1 and that of project 2. The load balancers in project 1 and project 2 will handle the traffic among resources in repective projects.