GKE Autopilot Static IP for Egress Traffic: Fixed Outbound IP Without NAT Gateway Complexity

QuotaGuard Engineering
March 18, 2026
5 min read
Pattern

QuotaGuard gives your GKE Autopilot pods a fixed outbound IP address. You configure one environment variable, point your HTTP client at the proxy, and hand the IP to your third-party vendor's support team. The allowlisting problem is solved permanently, without touching Cloud NAT or IP masquerade rules.

If you want the why and the full setup walkthrough, keep reading.

Why GKE Autopilot Makes Static Egress Harder Than It Should Be

Standard GKE (Autopilot or otherwise) assigns ephemeral IPs to pods. Your outbound traffic leaves Google's network from whatever IP the node happens to be using at that moment. For most internal traffic, that's fine. The moment a third-party API sits behind a firewall that requires IP allowlisting, you have a problem.

The standard Google-recommended answer is Cloud NAT. Set up a Cloud Router, attach a Cloud NAT gateway, reserve a static external IP, and route your cluster's egress through it. On a standard GKE cluster with node pools you control, this is manageable. On Autopilot, it's messier.

Autopilot manages nodes on your behalf. You don't control node pool configuration, and you can't apply arbitrary network policy at the node level the way you can on a standard cluster. Cloud NAT works at the VPC level, so it technically applies to Autopilot nodes, but the configuration surface is narrower and the interaction with Autopilot's automatic node provisioning creates edge cases. Nodes spun up in new zones may not pick up your NAT configuration immediately. Reserved IP quotas, Cloud Router redundancy, and zone-specific NAT rules add operational overhead that's easy to underestimate.

This is the exact situation described in the Google Dev community discussion linked above. A developer has a working Autopilot cluster, a third-party managed service requiring IP allowlisting, and no clean path to a fixed egress IP without significant infrastructure work.

The Proxy Approach: Simpler Than It Looks

There's a second path that most developers overlook because it feels "less official" than Cloud NAT: route your outbound requests through an HTTPS proxy that sits on a static IP. Your pod's source IP never matters. The request exits from the proxy's IP, which is fixed and predictable.

This is exactly how QuotaGuard works. It provides a proxy endpoint (a URL with credentials) that your HTTP client connects through. All outbound requests to your third-party service exit from QuotaGuard's fixed IP on AWS infrastructure. You give that IP to your vendor. Done.

No Cloud Router configuration. No NAT gateway. No zone-specific routing rules. No node pool access required. It works identically on Autopilot and standard GKE because it operates entirely at the application layer.

Setting It Up in a GKE Autopilot Pod

The setup has three steps: store your proxy URL as a Kubernetes secret, inject it as an environment variable in your deployment, and configure your HTTP client to use it.

Step 1: Create the Secret

kubectl create secret generic quotaguard-config \
  --from-literal=QUOTAGUARDSTATIC_URL='http://username:password@proxy.quotaguard.com:9293'

Replace the URL with the one from your QuotaGuard dashboard. Keep credentials out of your container image and your git history.

Step 2: Inject the Environment Variable

In your Deployment manifest, reference the secret:

env:
  - name: QUOTAGUARDSTATIC_URL
    valueFrom:
      secretKeyRef:
        name: quotaguard-config
        key: QUOTAGUARDSTATIC_URL

Step 3: Use the Proxy in Your Application

Most HTTP clients support proxy configuration through environment variables or constructor arguments. Here's a Python example using the requests library, which is common for services that call third-party APIs:

import os
import requests

proxy_url = os.environ.get("QUOTAGUARDSTATIC_URL")

proxies = {
    "http": proxy_url,
    "https": proxy_url,
}

response = requests.get(
    "https://api.your-third-party-service.com/endpoint",
    proxies=proxies,
)

print(response.status_code)

That's the entire integration. The requests library handles the proxy tunnel. Your pod's IP is irrelevant. The request arrives at the third-party service from QuotaGuard's fixed IP.

Node.js, Go, Ruby, and Java all have equivalent proxy support in their standard HTTP libraries. The pattern is the same: read the proxy URL from the environment variable, pass it to your HTTP client.

What About Cloud NAT? When Does It Still Make Sense?

Cloud NAT is the right answer in a few specific situations:

  • You need all traffic from your cluster to exit through a fixed IP, not just specific service calls. Cloud NAT is a network-level control. A proxy requires per-client configuration.
  • You're using protocols other than HTTP or HTTPS. Proxies work at the application layer. UDP traffic, raw TCP connections, and non-HTTP protocols won't route through an HTTPS proxy.
  • You already have a GCP networking team managing Cloud Routers and NAT gateways for other infrastructure. Adding one more NAT config is low overhead in that context.

If your use case is "my Python service needs to call a REST API that requires IP allowlisting," Cloud NAT is more infrastructure than the problem requires. The proxy approach is faster to set up, easier to audit, and trivial to replicate across staging and production environments by swapping the secret value.

Costs: Cloud NAT vs. a Proxy Service

Cloud NAT charges for the NAT gateway uptime plus per-GB data processing fees. At low to moderate traffic volumes, the gateway itself costs roughly $32/month before data charges. You also pay for the reserved static external IP whether traffic flows through it or not.

QuotaGuard's Micro plan is $19/month for shared IPs with 250MB of data. The Medium plan is $49/month for 1GB. For services making moderate API call volumes, the proxy is cheaper and simpler to operate. If you need a dedicated IP that no other customer shares, that's available on the Enterprise plan at $219/month.

Run the numbers for your traffic volume. For typical third-party API integrations, the proxy wins on cost and operational simplicity. For high-volume egress or non-HTTP protocols, Cloud NAT may be the better choice.

Staging and Production Configuration

One practical advantage of the proxy approach in Kubernetes: you can use different proxy credentials per environment with no code changes. Create separate secrets in your staging and production namespaces. Your deployment manifests are identical. Switching environments doesn't require touching NAT gateway configurations or re-reserving IPs.

# Staging namespace
kubectl create secret generic quotaguard-config \
  --namespace=staging \
  --from-literal=QUOTAGUARDSTATIC_URL='http://staging-user:staging-pass@proxy.quotaguard.com:9293'

# Production namespace
kubectl create secret generic quotaguard-config \
  --namespace=production \
  --from-literal=QUOTAGUARDSTATIC_URL='http://prod-user:prod-pass@proxy.quotaguard.com:9293'

Your application code reads the same environment variable in both cases. The proxy handles the rest.

Inbound Static IP: The Other Direction

If your situation is reversed and you need a fixed IP for inbound traffic to a service running inside your GKE cluster, QuotaGuard Static Shield handles that case. It provides a fixed inbound IP that tunnels through to your cluster without requiring a public LoadBalancer or a static GCP external IP reservation. The setup uses QGTunnel, which runs as a sidecar or init container in your deployment. Worth knowing about if your requirements go both directions.

Get a Fixed Egress IP for Your GKE Autopilot Cluster

If you have a third-party API blocking your Autopilot pods because your egress IP keeps changing, the fastest fix is a proxy. Configure it in 15 minutes, hand the IP to your vendor, and move on to the actual work. Start with the Micro plan at $19/month and upgrade if your data volume requires it. See the full pricing breakdown at quotaguard.com/products/pricing.

QuotaGuard Static IP Blog

Practical notes on routing cloud and AI traffic through Static IPs.

Reliability Engineered for the Modern Cloud

For over a decade, QuotaGuard has provided reliable, high-performance static IP and proxy solutions for cloud environments like Heroku, Kubernetes, and AWS.

Get the fixed identity and security your application needs today.