dacopenhagen
dacopenhagen

Reputation: 2510

Connecting Google Cloud Build to Private Endpoints

I have a VPC network and that network has a private endpoint for my database connection. All servers are able to connect to the database without fail. However, once I turn on a cloud build (in a private pool, in the same VPC network), the cloud build system cannot seem to find or connect to my private endpoint to build out the static pages of the website.

Do I need to setup a special VPN? how can I even begin to troubleshoot this?

Upvotes: 0

Views: 710

Answers (2)

PaVliK
PaVliK

Reputation: 29

Regarding the comment below, with PSCs it's still the same as it's not possible to connect to the PSC endpoints from another VPC peered with the VPC where the endpoint is located :|. Check out this Google Tracker issue

Upvotes: 0

guillaume blaquiere
guillaume blaquiere

Reputation: 75810

Sadly yes, you have to set up a VPN as described in that documentation (for GKE but the principle in the same)

In fact, you need to have a look to the underlying architecture.

  • From Cloud Build private pool to your VPC, a peering is created
  • From your VPC to Cloud SQL private IP (or GKE Private control plane, or mongo-db Atlas), a peering is created

Therefore the network architecture is the following

Cloud Build private Pool -> peering -> VPC -> peering -> Cloud SQL private IP

One of limitation of VPC peeing on GCP is the non-transitivity ( if A -> B and B -> C, then A can't reach C)

That's why a VPN is a (non glorious) solution

Upvotes: 3

Related Questions