Under standard settings, a resource in a Virtual Private Cloud (VPC) that lacks an external IP address cannot communicate with external services or Google APIs. To bridge this gap, Private Google Access and Private Service Connect allow internal resources to connect to these services securely without using public IP addresses. This configuration ensures that sensitive data traffic remains entirely within the Google network and reduces exposure to external threats.
For serverless environments like Cloud Run and Cloud Functions, secure communication with internal resources requires Serverless VPC Access. This tool uses a connector to route outbound traffic from the serverless environment to the internal IPv4 addresses of resources hosted inside the VPC, such as databases or virtual machines. This connector is vital for serverless applications that must access private backend data without exposing traffic to the public internet.
Alternatively, Private Service Connect establishes a service abstraction that allows workloads to be reached across different VPC networks using a single private IP address. It manages both Layer 4 and Layer 7 traffic to connect consumers directly to Google APIs or hosted producer services. The system relies on three main components to manage this connectivity:
To prevent data exfiltration, administrators can deploy VPC Service Controls to establish a strict security perimeter around these cloud resources. This tool is frequently paired with a Shared VPC, which centralizes network policy and resource control in a single host project. By combining these services, organizations ensure their serverless workloads connect safely and only communicate with authorized endpoints.
A Virtual Private Cloud (VPC) serves as the fundamental private network partition for virtual resources. Many organizations deploy a Shared VPC, which connects a central host project to multiple service projects so a network team can manage subnets while developers deploy Compute Engine virtual machines and GKE clusters. Designing a custom-mode VPC is highly recommended because it grants precise control over subnet IP allocations and regional layouts.
Inside container environments, VPC-native clusters are the standard choice because they use alias IP ranges to assign a unique, routable IP address to every Kubernetes Pod. This model allows VPC firewall rules to secure Pod traffic directly and eliminates the need for complex, static routing tables. Proper IP address management is crucial during setup to prevent address exhaustion as nodes and Pods scale.
To maintain a strong security posture, administrators should limit external IP addresses on compute resources and use Private Google Access for internal connections to Google services. When private virtual machines or GKE nodes need to reach the internet for software updates, Cloud NAT provides secure network address translation. This service allows outbound connections while blocking unsolicited inbound traffic from the public internet.
Securing containerized traffic requires combining VPC firewall rules at the virtual machine level with Kubernetes network policies at the Pod level. While firewall rules manage boundary traffic, network policies prevent unauthorized lateral movement between containers inside the cluster. Security can be further enhanced using three main strategies:
Traffic enters the network through Cloud Load Balancing, which routes user requests across multiple regions to ensure high availability. For GKE workloads, container-native load balancing integrates directly with Network Endpoint Groups (NEGs) to send traffic straight to Pod IP addresses, removing extra network hops. This direct routing path works alongside Horizontal Pod Autoscaling to seamlessly handle shifts in user demand.
Google Cloud VMware Engine (GCVE) is a fully managed service that hosts VMware environments on dedicated Google Cloud bare-metal infrastructure. To establish stable hybrid connections between an on-premises data center and GCVE, organizations deploy Cloud VPN or Cloud Interconnect. This setup allows enterprise workloads to migrate to the cloud while keeping existing VMware tools and workflows intact.
Within the cloud, VPC Network Peering creates a direct, private connection between your native VPC network and the GCVE environment. Once connected, NSX-T operates as the software-defined networking layer to manage routing and micro-segmentation for your virtual machines. Administrators must configure specific NSX-T network segments to allow seamless communication across these hybrid environments.
Virtual machines in GCVE can be protected by deploying third-party network appliances directly from the Google Cloud Marketplace to act as firewalls. These appliances offer advanced threat defense, including Deep Packet Inspection and Intrusion Prevention Systems, to block malicious traffic. These components cooperate to support a defense-in-depth strategy through several key features:
Moving workloads from local servers into GCVE is simplified by using VMware HCX, which coordinates the underlying migration paths between sites. To distribute incoming user traffic to the migrated workloads, administrators set up Cloud Load Balancing in front of the services. Applying Cloud Armor security policies to this load balancer provides a final, robust shield against external web application threats.
Intrigued by the art of cloud architecture? Discover how to design, develop, and manage robust, secure, scalable, and dynamic solutions on Google Cloud as you prepare for the Professional Cloud Architect exam!
Prepare and test your skills
Prepare and test your skills
Private Google Access enables resources in a VPC without external IP addresses to connect to Google APIs internally, keeping traffic within the Google network. Private Service Connect establishes a service abstraction that allows workloads to be reached across different VPC networks using a single private IP address and manages both Layer 4 and Layer 7 traffic to connect consumers directly to Google APIs or hosted producer services.
You should use Serverless VPC Access when Cloud Run or Cloud Functions need secure communication with internal resources hosted inside your VPC, such as databases or virtual machines. It uses a connector to route outbound traffic from the serverless environment to internal IPv4 addresses, allowing access to private backend data without exposing traffic to the public internet.
VPC-native clusters use alias IP ranges to assign a unique, routable IP address to every Kubernetes Pod. This model allows VPC firewall rules to secure Pod traffic directly and eliminates the need for complex, static routing tables, providing simpler IP address management and better integration with VPC networking.
VPC firewall rules manage boundary traffic at the virtual machine level, controlling ingress and egress for nodes and instances. Kubernetes network policies operate at the Pod level inside the cluster to prevent unauthorized lateral movement between containers, providing finer-grained control over container-to-container communication.
Create a Serverless VPC Access connector in us-central1 attached to the VPC network, configure the Cloud Run service to use the connector, and set the VPC egress setting to Route all traffic to the VPC.
Configure a Cloud NAT gateway on the VPC subnet, associate the subnet with Cloud Run, and enable Private Google Access on the subnet without provisioning a connector.
Create a Serverless VPC Access connector in us-central1 attached to the VPC network, configure the Cloud Run service to use the connector, and keep the default VPC egress setting to Route only requests to private IPs to the VPC.
Create an internal Application Load Balancer with a Private Service Connect backend NEG, and configure Cloud Run ingress to internal-and-cloud-load-balancing.
Your company runs containerized backend workloads on Cloud Run in the us-central1 region. These serverless applications must communicate securely with the following resources:
All traffic between Cloud Run, the internal VMs, and Google APIs must traverse the VPC network without being routed over the public internet.
How should you configure the Cloud Run networking architecture to satisfy these requirements?