GCP Private Service Connect, Step by Step

Build a PSC connection, one piece at a time

Each step adds one piece. Press Send a packet to see how far a packet gets. Press the red button to remove the piece and see what breaks. When you know why each piece exists, the whole design follows.

The one idea to hold

The customer VPC and our VPC have no routes to each other, and here they even use the same range (10.1.0.0/16). The client and one of our nodes both have IP 10.1.0.11. Every piece below exists to make one connection work between two networks that cannot see each other.

Customer VPC · 10.1.0.0/16 Customer creates: endpoint, DNS record Google YBM cluster VPC · 10.1.0.0/16 YBM creates: NAT subnet, service attachment, firewall rule Client app 10.1.0.11 Internal LB lb-<id> 10.1.0.5 tserver node 10.1.0.11 same IP as the client PSC NAT subnet 100.64.64.0/25 Service attachment accept: acme-prod takes source IPs from Firewall rule allow 100.64.64.0/25 → :5433, 9042 PSC endpoint 10.1.9.20 Private DNS record <cluster-host> → 10.1.9.20
Packet log

    Press Send a packet. The log shows source and destination at each hop.

    All the pieces on one table

    PieceWhoOne-line jobWithout itSwitchboard picture
    NAT subnetYBMGives each incoming connection a source IP that our VPC ownsOur node cannot reply. GCP will not create the attachment.Visitor extensions
    Service attachmentYBMThe door: points at the LB, holds the accept listNothing for the customer to point atSwitchboard with a guest list
    Firewall ruleYBMLets NAT addresses reach the nodes on 5433, 9042Nodes drop every packetStaff take calls from visitor extensions
    EndpointCustomerAn IP in their VPC that leads to our doorTheir apps have no address that goes to usSpeed-dial button in their office
    DNS recordCustomerGives the endpoint IP the name on our TLS certificateWorks with sslmode=require only. verify-full fails.Name in the contact list