I've found two references (here and here) in the GCP docs saying that I may reserve an IPv4 address in the host project and use it in the service project:
A regional external IP address must be defined in either the same project as the load balancer or the Shared VPC host project.
Static external IPv4 addresses: External IPv4 address objects defined in the host project can be used by resources in either that host project or any attached service project.
My case is that I have a host project where I have a Shared VPC network and I've reserved an external IP address there. Now I would like to assign this IPv4 address to a GKE LoadBalancer service in a service project as described in here, ie. I want to type it in the spec.loadBalancerIP field in k8s Service.
I'm positive that the Shared VPC is somewhat properly configured as I have two clusters (one in the host project and one in the service project) running and I'm able to query podA@host-k8s-cluster from podB@service-k8s-cluster, but as for the k8s Service with type: LoadBalancer in the service project, I'm getting the following error message:
Error syncing load balancer: failed to ensure load balancer requested ip "..." is neither static nor assigned to the LB How do I properly use/share this ext. IPv4 address to the service project's k8s LoadBalancer Service?
As a side note, the docs also mention that all the GCP load-balancer services must be defined within the same (ie. service) project as the cluster, which happens automatically if the IPv4 address is also in the same project, but I can't see any of these resources being created in the service project if I specify ext IPv4 address from the host project.