Guide · Deploy
Private LLM on Google Cloud with GKE
Serve an open-weight model with vLLM on GKE private nodes and L4 GPUs, behind an external Application Load Balancer and Cloud Armor, with weights in Cloud Storage and no service-account keys. Covers path choice, GPUs in India, manifests, autoscaling and rollout.
- Step 1: Request in. Your apps and agents call one HTTPS endpoint. The external Application Load Balancer is the only public entry point, and Cloud Armor rules filter traffic before it reaches the cluster.
- Step 2: Into a private cluster. The load balancer routes to the gateway service in a GKE cluster whose nodes have no public IP addresses.
- Step 3: The gateway checks the caller. Per-team keys, quotas and usage metering, then routing to the right model or adapter. GKE Inference Gateway can add model-aware routing when one deployment serves several LoRA fine-tunes.
- Step 4: Inference on L4 GPUs. vLLM pods run on a GPU node pool. Each g2-standard-4 node has one NVIDIA L4 with 24 GB. A pod autoscaler adds vLLM replicas as the queue grows, and the cluster autoscaler adds GPU nodes when those replicas can't be scheduled.
- Step 5: Weights from Cloud Storage. Pods load a pinned, versioned copy of the weights from a Cloud Storage bucket over Private Google Access, either mounted with the Cloud Storage FUSE CSI driver or copied at start-up.
- Step 6: No keys in the cluster. API keys live in Secret Manager, encryption keys in Cloud KMS, and pods authenticate with Workload Identity Federation instead of downloaded service-account keys.
- Step 7: Watch latency, errors and spend. Managed Service for Prometheus scrapes the model servers, and Cloud Monitoring holds the dashboards and alerts for latency, error rate, GPU memory and cost.
This guide walks through the diagram above: an open-weight model served by vLLM on a GKE cluster whose nodes have no public IP, inside your own Google Cloud project. One external Application Load Balancer is the only way in. Weights come from Cloud Storage, keys from Secret Manager, and pods authenticate without downloaded service-account keys.
Reference architecture diagrams tend to skip the parts that break in production, so this guide spends its words there: which Google Cloud service to run on, which GPU you can actually get in India, the manifests, and how to scale and roll out. Versions and prices were checked on 23 November 2026.
Pick a path first
| Path | What you operate | Scale to zero | India availability | Pick it when |
|---|---|---|---|---|
| GKE (the diagram) | Cluster, node pools, vLLM pods, a gateway | Yes, with scheduled scale-down | L4, T4, H100, H200, RTX PRO 6000 | You want full control or already run Kubernetes |
| Gemini Enterprise Agent Platform endpoints (successor to Vertex AI) | Model and endpoint configuration | Not covered here | Check per model and machine type | You want managed endpoints and Model Garden deployments |
| Cloud Run with GPUs | A container image | Yes | L4 in Mumbai by invitation only; RTX PRO 6000 in Delhi | Spiky or low traffic, one model, simple ops |
What changes the decision:
- Gemini Enterprise Agent Platform (the successor to Vertex AI). Model Garden deploys open models on dedicated endpoints, and Google's vLLM serving guide uses the vLLM container. Google's best practice is a dedicated endpoint: public, or private over Private Service Connect. The older private endpoints that use VPC Network Peering are not recommended. The platform's managed tuning for open models also lets you export the tuned weights and deploy them elsewhere, including this cluster. We did not verify its prices for this guide.
- Cloud Run. Services can attach one NVIDIA L4 (24 GB) or RTX PRO 6000 Blackwell (96 GB) and scale to zero, with instance-based billing. An L4 service needs at least 4 vCPU and 16 GiB of memory. In India, L4 is listed for asia-south1 (Mumbai) by invitation only, and RTX PRO 6000 for asia-south2 (Delhi).
GPUs and prices
Google's GPU regions and zones table, read on 23 November 2026:
| GPU (machine series) | Mumbai (asia-south1) | Delhi (asia-south2) |
|---|---|---|
| L4 24 GB (G2) | zones a, b, c | none |
| T4 16 GB (N1) | zones a, b | none |
| H100 80 GB (A3 Edge) | zone c | none |
| H200 (A3 Ultra) | zone b | zone c |
| RTX PRO 6000 (G4) | zone c | zones a, c |
| A100 (A2) | none | none |
There is no A100 in either Indian region. The diagram uses a g2-standard-4: 4 vCPU, 16 GB RAM and one L4. It lists at $0.7068 an hour in us-central1 and $0.7358 in asia-south1, on demand, per gcloud-compute.com (a third-party mirror of Google's SKUs, updated 22 November 2026). Confirm in Google's pricing calculator before quoting a client.
An L4 holds a 7 to 9B model in BF16 with a modest KV cache, or a 14B model in FP8. L4 is an Ada GPU, so vLLM's FP8 W8A8 path works natively.
Walk through the diagram
Step 1: load balancer and Cloud Armor
Expose the gateway through the Kubernetes Gateway API. The gke-l7-global-external-managed GatewayClass creates a global external Application Load Balancer. Attach a Google-managed certificate through a Certificate Manager map with the networking.gke.io/certmap annotation.
kind: Gateway
apiVersion: gateway.networking.k8s.io/v1
metadata:
name: llm-edge
namespace: llm
annotations:
networking.gke.io/certmap: llm-cert-map
spec:
gatewayClassName: gke-l7-global-external-managed
listeners:
- name: https
protocol: HTTPS
port: 443
---
kind: HTTPRoute
apiVersion: gateway.networking.k8s.io/v1
metadata:
name: llm-api
namespace: llm
spec:
parentRefs:
- kind: Gateway
name: llm-edge
hostnames:
- "llm.example.com"
rules:
- backendRefs:
- name: llm-gateway
port: 8080Create a Cloud Armor policy with a per-IP rate limit:
gcloud compute security-policies create llm-edge \
--type=CLOUD_ARMOR --description="LLM API edge"
gcloud compute security-policies rules create 1000 \
--security-policy=llm-edge --src-ip-ranges="*" \
--action=throttle \
--rate-limit-threshold-count=600 --rate-limit-threshold-interval-sec=60 \
--conform-action=allow --exceed-action=deny-429 --enforce-on-key=IPAttach it, and fix the timeout, with a GCPBackendPolicy on the gateway Service. The backend timeout defaults to 30 seconds, which is shorter than many generations.
apiVersion: networking.gke.io/v1
kind: GCPBackendPolicy
metadata:
name: llm-gateway
namespace: llm
spec:
default:
securityPolicy: llm-edge
timeoutSec: 300
targetRef:
group: ""
kind: Service
name: llm-gateway
---
apiVersion: networking.gke.io/v1
kind: HealthCheckPolicy
metadata:
name: llm-gateway
namespace: llm
spec:
default:
config:
type: HTTP
httpHealthCheck:
port: 8080
requestPath: /healthz # your gateway's health path
targetRef:
group: ""
kind: Service
name: llm-gatewayTest any preconfigured WAF rules against real prompts in preview mode first. Prompts that contain code or HTML look like attacks to generic rules.
Step 2: a cluster with private nodes
Private nodes have no external IP. Private Google Access is turned on automatically unless you use Shared VPC, so nodes reach Google APIs without a NAT. They cannot reach Docker Hub or Hugging Face, which is the point: mirror the vLLM image into Artifact Registry and load weights from Cloud Storage. Add Cloud NAT only if something truly needs the internet.
gcloud container clusters create llm \
--location=asia-south1 \
--enable-private-nodes --enable-ip-alias \
--enable-dns-access \
--workload-pool=PROJECT_ID.svc.id.goog \
--addons=GcsFuseCsiDriver \
--enable-secret-manager \
--enable-managed-prometheus \
--num-nodes=1
gcloud container clusters update llm \
--location=asia-south1 --gateway-api=standardRestrict who can reach the control plane with authorized networks or the DNS-based endpoint.
Standard or Autopilot? Autopilot always has Workload Identity Federation on, enables the Cloud Storage FUSE driver by default, and runs managed Prometheus collection that you cannot turn off. You request a GPU with a node selector and Google manages the nodes. Standard, used here, gives you node pools you size yourself, which makes the scale-to-zero and driver choices explicit. Either works for this architecture.
Step 3: the gateway checks the caller
The gateway Deployment issues keys per team or agent, enforces quotas, meters tokens and routes by model name. LiteLLM is the common choice. On 21 October 2026 its official v1.107.0 release shipped credential-stealing malware on PyPI, Docker Hub and GHCR, including the latest and main-stable tags; earlier in 2026 it had CVE-2026-42208, a pre-auth SQL injection exploited within about 36 hours. If you run it, pin the image by digest, verify its cosign signature as described in LiteLLM's incident post, keep it on a Kubernetes ServiceAccount that can read only its own secrets, and limit its egress with a NetworkPolicy. A small proxy you own is a reasonable alternative.
When one base model serves several LoRA fine-tunes, GKE Inference Gateway adds load-aware and model-aware routing through InferencePool and InferenceObjective resources, and lets one pool serve several LoRA adapters. It supports only the regional gke-l7-rilb and gke-l7-regional-external-managed classes. Check how Cloud Armor policies and certificates attach to a regional Gateway before you adopt it; the setup differs from the global Gateway used above.
Step 4: vLLM on an L4 node pool
Create the GPU pool with automatic driver installation. Valid driver values are default, latest (Container-Optimized OS nodes only) and disabled. The driver must be new enough for the CUDA version your vLLM image was built with, so check before an upgrade.
gcloud container node-pools create l4 \
--cluster=llm --location=asia-south1 \
--node-locations=asia-south1-a,asia-south1-b \
--machine-type=g2-standard-4 \
--accelerator=type=nvidia-l4,count=1,gpu-driver-version=latest \
--enable-autoscaling --min-nodes=0 --max-nodes=2 \
--workload-metadata=GKE_METADATA--min-nodes and --max-nodes apply per zone, so this pool can grow to four nodes. The Deployment pins the image by digest (vLLM v0.34.0, mirrored), requests one GPU, mounts the weights read-only, and only reports ready once /health answers:
apiVersion: apps/v1
kind: Deployment
metadata:
name: vllm-qwen
namespace: llm
spec:
replicas: 1
selector:
matchLabels:
app: vllm-qwen
template:
metadata:
labels:
app: vllm-qwen
annotations:
gke-gcsfuse/volumes: "true"
spec:
serviceAccountName: vllm
nodeSelector:
cloud.google.com/gke-accelerator: nvidia-l4
containers:
- name: vllm
image: asia-south1-docker.pkg.dev/PROJECT_ID/llm/vllm-openai@sha256:DIGEST
args:
- --model=/models/qwen3.5-9b/REVISION
- --served-model-name=qwen3.5-9b
- --max-model-len=16384
ports:
- name: http
containerPort: 8000
resources:
requests:
cpu: "2"
memory: 10Gi
nvidia.com/gpu: "1"
limits:
nvidia.com/gpu: "1"
startupProbe:
httpGet:
path: /health
port: 8000
periodSeconds: 10
failureThreshold: 90
readinessProbe:
httpGet:
path: /health
port: 8000
periodSeconds: 10
volumeMounts:
- name: models
mountPath: /models
readOnly: true
- name: dshm
mountPath: /dev/shm
volumes:
- name: models
csi:
driver: gcsfuse.csi.storage.gke.io
readOnly: true
volumeAttributes:
bucketName: BUCKET_NAME
mountOptions: "implicit-dirs"
- name: dshm
emptyDir:
medium: Memory
sizeLimit: 2Gi
---
apiVersion: v1
kind: Service
metadata:
name: vllm-qwen
namespace: llm
spec:
selector:
app: vllm-qwen
ports:
- name: http
port: 8000
targetPort: 8000The startup probe gives the model up to 15 minutes to load before Kubernetes restarts it. The memory-backed /dev/shm stands in for Docker's --ipc=host, which vLLM uses for shared memory. Leave --gpu-memory-utilization unset: the v0.34.0 release notes say most deployments should now remove it, because the extensible KV cache sizes itself. Set it only if another process shares the GPU. Keep --trust-remote-code off (the default) and run v0.28 or later, which fixes CVE-2026-27893 and CVE-2026-90553.
Step 5: weights from Cloud Storage
Keep each revision under its own prefix with a checksum manifest, in a bucket with versioning on and public access prevented:
gcloud storage buckets create gs://BUCKET_NAME --location=asia-south1 \
--uniform-bucket-level-access --public-access-prevention
gcloud storage buckets update gs://BUCKET_NAME --versioning
gcloud storage buckets add-iam-policy-binding gs://BUCKET_NAME \
--member="principal://iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/PROJECT_ID.svc.id.goog/subject/ns/llm/sa/vllm" \
--role=roles/storage.objectViewerFor customer-managed keys, add --default-encryption-key with your Cloud KMS key. The pod mounts the bucket with the Cloud Storage FUSE CSI driver; the gke-gcsfuse/volumes: "true" annotation is required for the driver to inject its sidecar. If load times matter, copy the weights to local SSD in an init container instead. Rollback of weights is a change of the --model path.
Step 6: no keys in the cluster
Workload Identity Federation for GKE lets you grant IAM roles directly to a Kubernetes ServiceAccount, as in the bucket binding above. The vLLM pods read the bucket; the gateway reads its secrets; neither can do the other's job.
The Secret Manager add-on mounts secrets as files:
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
name: llm-gateway-keys
namespace: llm
spec:
provider: gke
parameters:
secrets: |
- resourceName: "projects/PROJECT_ID/secrets/gateway-master-key/versions/1"
path: "master-key"In the gateway pod, mount a volume with driver: secrets-store-gke.csi.k8s.io and secretProviderClass: llm-gateway-keys under volumeAttributes. Grant the gateway's ServiceAccount roles/secretmanager.secretAccessor on that secret only, using the same principal:// member format.
Step 7: metrics and alerts
Managed Service for Prometheus collection is on by default for Standard clusters on GKE 1.27 and later. Point a PodMonitoring at vLLM's port; it scrapes /metrics by default.
apiVersion: monitoring.googleapis.com/v1
kind: PodMonitoring
metadata:
name: vllm
namespace: llm
spec:
selector:
matchLabels:
app: vllm-qwen
endpoints:
- port: http
interval: 30sAlert in Cloud Monitoring on vLLM's metrics: vllm:time_to_first_token_seconds, vllm:e2e_request_latency_seconds, vllm:num_requests_waiting and vllm:kv_cache_usage_perc, plus load balancer 5xx rates and a billing budget alert for spend.
Autoscaling
Two layers scale together. The Horizontal Pod Autoscaler adds vLLM replicas; the cluster autoscaler adds an L4 node when a GPU pod is Pending and removes idle nodes.
Scale pods on the queue, not on GPU utilization. Google's LLM autoscaling best practices recommend queue size when optimizing throughput and cost, and batch size when latency targets are tight. They also note that GPU utilization does not measure how much work the GPU is doing, and that GPU memory only scales up for servers like vLLM that preallocate memory.
For vLLM the queue metric is vllm:num_requests_waiting. Google's HPA walkthrough exposes Managed Prometheus metrics to the HPA through the Custom Metrics Stackdriver Adapter, using names like prometheus.googleapis.com|tgi_queue_size|gauge for a TGI server. Its examples are for TGI, so confirm the exact vLLM metric name in Metrics Explorer before you write the HPA.
An HPA does not scale a Deployment to zero, so scale the Deployment to zero on a schedule for overnight idle hours. The cluster autoscaler then drains the GPU nodes down to the pool's minimum of zero.
Rollout and rollback
Run a new model revision or vLLM version as a second Deployment and Service, then shift traffic gradually. If your gateway supports weighted routing, do it there. Otherwise put an internal Gateway (gke-l7-rilb) in front of the model Services and split with weighted backendRefs:
rules:
- backendRefs:
- name: vllm-qwen
port: 8000
weight: 95
- name: vllm-qwen-v2
port: 8000
weight: 5Move from 5 to 25 to 100 percent while watching latency, errors and your eval scores. Rollback is setting the new backend's weight to 0. For an in-place image change on one Deployment, kubectl rollout undo deployment/vllm-qwen -n llm returns to the previous revision.
Cost controls
- Let the pool reach zero. With a minimum of zero nodes per zone and scheduled scale-down, idle nights cost nothing in GPU hours.
- Use Spot VMs for evals and batch jobs, in a separate node pool, never for the only serving replica.
- Right-size first. Use FP8 on L4 or a 4-bit quant before moving to a bigger GPU, and cap
--max-model-lenat what your prompts need. - Count the rest. The load balancer, cluster management and Cloud Storage add to the GPU line.
Cost
One g2-standard-4 running all month (730 hours) is about $516 in us-central1 and $537 in Mumbai at the on-demand rates above, before load balancer and cluster charges.
Sources
- vLLM documentation
- vLLM: Using Docker
- vLLM: vllm serve CLI reference
- vLLM: Online serving (health endpoint)
- vLLM: Production metrics
- vLLM: Quantization
- Docker Hub: vllm/vllm-openai tags
- NVD: CVE-2026-27893
- Red Hat: CVE-2026-90553
- LiteLLM: Oct 21, 2026 release v1.107.0 compromised
- Cloud Security Alliance: LiteLLM pre-auth SQLi exploited in 36 hours (CVE-2026-42208)
- Google Cloud: GPU regions and zones
- gcloud-compute.com: g2-standard-4
- Google Cloud: Choose an endpoint type (Agent Platform)
- Google Cloud: vLLM serving for text-only and multimodal language models on Cloud GPUs
- Google Cloud: Tune an open model (Agent Platform)
- Google Cloud: Configure GPUs for Cloud Run services
- Google Cloud: Deploying Gateways
- Google Cloud: Configure Gateway resources using Policies
- Google Cloud Armor: Configure rate limiting
- gcloud reference: compute security-policies create
- Google Cloud: Customize network isolation in GKE
- Google Cloud: Run GPUs in GKE Standard node pools
- gcloud reference: container node-pools create
- Google Cloud: Serve an LLM with GKE Inference Gateway
- Google Cloud: Set up the Cloud Storage FUSE CSI driver for GKE
- Google Cloud: Mount Cloud Storage buckets as CSI ephemeral volumes
- gcloud reference: storage buckets create
- gcloud reference: storage buckets update
- Google Cloud: Authenticate to Google Cloud APIs from GKE workloads (Workload Identity Federation)
- Google Cloud: Use the Secret Manager add-on with GKE
- Google Cloud: Get started with managed collection (Managed Service for Prometheus)
- Google Cloud: Best practices for autoscaling LLM inference workloads with GPUs
- Google Cloud: Configure autoscaling for LLM workloads on GPUs with GKE