2

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.

1 Answer 1

0

I have the same problem with Terraform and IGM:

Error adding new access_config: googleapi: Error 400: Invalid value for field 'resource.natIP': 'projects/***/regions/me-west1/addresses/video-lb-me-west1'. The specified external IP address 'projects/***/regions/me-west1/addresses/video-lb-me-west1' was not found in region 'me-west1'., invalid 

but the Global IP address working

1
  • This does not really answer the question. If you have a different question, you can ask it by clicking Ask Question. To get notified when this question gets new answers, you can follow this question. Once you have enough reputation, you can also add a bounty to draw more attention to this question. - From Review Commented Jan 13 at 13:07

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.