Configure Centralized Egress with GCP VPC Peering
|
This feature is in beta and is available only on GCP BYOC clusters with private networking. Availability is controlled per organization. Contact your account team to request access to centralized egress. |
Centralized egress lets your BYOC cluster send all internet-bound traffic through your own GCP hub VPC instead of a Redpanda-managed Cloud NAT, so outbound traffic exits through a single, predictable public IP that you control.
After reading this page, you will be able to:
-
Enable centralized egress on a new BYOC cluster using the Redpanda Cloud UI
-
Identify the shared responsibility boundaries between Redpanda and your hub project
-
Troubleshoot egress failures caused by misconfigured hub routes or VPC peering
When to use centralized egress
Use centralized egress when:
-
Your security policy prohibits per-VPC Cloud NAT and requires all internet-bound traffic to traverse a centralized inspection point such as a firewall appliance.
-
You already operate a hub-and-spoke network in GCP and want Redpanda to fit into that topology.
-
You want to consolidate egress through a single, predictable public IP for outbound allowlisting on external services.
-
You want to reduce Cloud NAT fees on high-throughput Redpanda workloads.
If none of these apply, the default Cloud NAT egress used by standard BYOC clusters is simpler and requires no extra customer-managed infrastructure.
How it works
Without centralized egress, the Redpanda agent creates a Cloud Router and Cloud NAT inside the Redpanda VPC. With centralized egress enabled, the agent creates the spoke VPC without a Cloud Router or Cloud NAT and establishes VPC Network Peering to your hub VPC with import_custom_routes = true. The hub VPC exports a 0.0.0.0/0 route pointing to the NAT VM’s internal IP. The spoke VPC imports that route and uses it for all internet-bound traffic.
The following diagram shows the connectivity model:
+-------------------------------+ +-------------------------------+
| Redpanda VPC | | Customer Hub VPC |
| (Redpanda project) | | (Customer project) |
| | | |
| VPC Network Peering +<------->+ VPC Network Peering |
| import_custom_routes=true | | export_custom_routes=true |
| 0.0.0.0/0 -> NAT VM IP (imp) | | 0.0.0.0/0 -> NAT VM IP (exp) |
| No Cloud Router / Cloud NAT | | NAT VM (e2-micro, MIG) |
| GKE Worker Nodes | | Static public IP |
+-------------------------------+ +----------+--------------------+
|
v
Internet
(Cloudsmith, public.ecr.aws,
NTP, Helm)
Outbound traffic flow
-
A GKE node in a Redpanda subnet sends a packet destined for the internet.
-
The spoke VPC has no local
0.0.0.0/0route, so the imported peering route (0.0.0.0/0→ NAT VM internal IP) applies. -
The packet crosses the VPC peering to the hub VPC and arrives at the NAT VM.
-
The NAT VM performs IP masquerade and forwards the packet through its static public IP.
Prerequisites
Before you configure centralized egress, confirm all of the following:
-
Centralized egress is enabled on your Redpanda Cloud organization. Contact your account team to request access.
-
Your BYOC cluster uses private networking (connection type Private). Centralized egress is not available on clusters with a public connection type.
-
You have provisioned a hub VPC in the same GCP region as the planned Redpanda BYOC cluster. See Create a GCP Hub for Centralized Egress if you need to provision a hub.
-
The hub subnet CIDR and the planned Redpanda spoke VPC CIDR do not overlap.
GCP rejects VPC peering when CIDRs overlap. Even when peering succeeds, a local static
0.0.0.0/0route in the spoke VPC silently wins over the imported peering route. The Redpanda provisioner does not create a local default route when centralized egress is enabled, but verify that no pre-existing local default route exists in the spoke before provisioning.Use a non-overlapping range for your hub subnet. The
100.64.0.0/20CGNAT range is a safe default because it rarely conflicts with typical RFC 1918 workload CIDRs. -
You know the hub VPC name and the hub GCP project ID. These are collected at the end of Create a GCP Hub for Centralized Egress.
Shared responsibility model
| Component | Owner |
|---|---|
Redpanda spoke VPC, subnets, and GKE cluster |
Redpanda |
Spoke VPC peering with |
Redpanda |
No Cloud Router or Cloud NAT in the spoke VPC |
Redpanda |
Hub VPC and hub subnet |
Customer |
Hub VPC peering with |
Customer |
Untagged route |
Customer |
NAT VM instance and Managed Instance Group |
Customer |
Static public IP for NAT |
Customer |
Firewall rules allowing spoke CIDR traffic to reach the NAT VM |
Customer |
Egress path availability and HA |
Customer |
Redpanda does not manage the availability of the egress path. Size the NAT VM appropriately for your expected egress throughput. See Create a GCP Hub for Centralized Egress for sizing guidance.
Limitations
-
Centralized egress is set at network creation through the Redpanda Cloud UI.
-
All clusters that peer to the same hub share a single public egress IP and the same NAT VM throughput capacity.
Configure egress at network creation
Centralized egress is set at network creation. Complete all hub-side setup before you start the cluster creation flow. See Create a GCP Hub for Centralized Egress.
To enable centralized egress, use the Redpanda Cloud UI:
-
Log in to Redpanda Cloud.
-
On the Clusters page, click Create cluster, then click Create for BYOC.
-
Complete the cluster details. See Create a BYOC Cluster on GCP for the full create flow.
-
On the Network page, enter the Hub VPC name and Hub project ID using the values you collected in Collect the values to provide to Redpanda. These fields are only visible if centralized egress is enabled for your organization.
-
Click Next and complete the remaining steps.
|
After you click Create, the Redpanda provisioner creates the spoke VPC without a Cloud Router or Cloud NAT, and establishes VPC Network Peering to the hub VPC with |
What Redpanda provisions automatically
When you run rpk byoc gcp apply, the Redpanda provisioner:
-
Creates the cluster VPC without a Cloud Router, Cloud NAT, or local default route.
-
Creates the reciprocal VPC Network Peering from the Redpanda VPC to the hub VPC with
import_custom_routes = true. -
The
0.0.0.0/0→ NAT VM internal IP route exported from the hub is imported, and all internet-bound traffic flows through the hub NAT VM.
Internet endpoints required from your hub
The NAT VM in your hub VPC must provide internet egress for the following endpoints. If your hub firewall enforces an allowlist, allow outbound traffic to these endpoints from the Redpanda spoke CIDR:
| Endpoint | Protocol and port | Purpose |
|---|---|---|
|
TCP/443 |
Redpanda container images |
|
TCP/443 |
GKE public CNI and network policy agent images |
NTP servers |
UDP/123 |
Time sync |
|
TCP/443 |
Monitoring stack Helm charts |
DNS resolution
Centralized egress does not affect DNS resolution. The Redpanda VPC uses GCP’s internal DNS resolver, which resolves both internal and external hostnames as long as the 0.0.0.0/0 route is importable from the hub peering. No additional DNS configuration is required.
Adding more clusters
To connect an additional Redpanda cluster to the same hub, create a new hub-side peering connection for each cluster using a unique peering name (for example, hub-to-redpanda-cluster-b) and then configure centralized egress at cluster creation. All clusters share the same NAT VM and exit from the same public IP.
|
The NAT VM funnels all internet egress for all peered clusters through a single instance. If egress bandwidth becomes a bottleneck, recreate the instance template with a larger machine type (for example, |
Troubleshooting
| Symptom | Likely cause |
|---|---|
Cluster creation does not complete |
The cluster cannot reach the external endpoints it needs during bootstrap. Verify that the hub-side VPC peering has |
The spoke VPC has no |
The hub-side peering does not have |
Peering is stuck in |
Both sides of the peering must be established for it to become |
Spoke VPC has a local |
Local static routes always beat imported VPC peering routes in GCP regardless of priority. The Redpanda provisioner does not create a local default route when centralized egress is enabled. If an unexpected local default route appears, contact Redpanda Support. |
Peering creation fails with a permissions error |
The principal creating the hub-side peering needs |
Traffic exits from an unexpected IP |
The NAT VM may have been replaced and the startup script did not run correctly. SSH into the NAT VM and run |
All traffic appears from one IP |
Correct. This is the centralized egress design, and all peered clusters share the single public IP assigned to the NAT VM. |
Next steps
-
Add a BYOC VPC Peering Connection on GCP (for routing client traffic, not egress)