Autopilot Clusters with GKE managed DRANET: GPUs and TPUs
TL;DR · AI 摘要
Google Cloud Blog详解GKE Autopilot集群配置DRANET支持GPU/TPU的完整流程,包含代码示例和参数说明。
核心要点
- GKE Autopilot集群部署需指定VPC网络和预留资源URL
- ComputeClass配置需定义GPU型号、数量及加速器网络策略
- ResourceClaimTemplate区分GPU(RDMA)和TPU资源类型
结构提纲
按章节快速跳转。
思维导图
用一张图看清主题之间的关系。
查看大纲文本(无障碍 / 无 JS 友好)
- GKE Autopilot DRANET配置
- 部署流程
- VPC创建
- ComputeClass定义
- ResourceClaimTemplate配置
- 关键组件
- Autopilot集群
- DRANET网络
- GPU/TPU加速器
金句 / Highlights
值得收藏与分享的关键句。
gcloud container clusters create-auto命令需指定--network和--subnetwork参数
ComputeClass配置中acceleratorNetworkProfile:auto实现自动网络策略匹配
ResourceClaimTemplate区分GPU(RDMA)和TPU资源类型确保网络接口正确分配
Autopilot Clusters with GKE managed DRANET: GPUs and TPUs | Google Cloud Blog
Developers & Practitioners
Autopilot Clusters with GKE managed DRANET: GPUs and TPUs
July 9, 2026
##### Ammett Williams
Developer Relations Engineer
Google Kubernetes Engine (GKE) managed DRANET supports both GPUs and TPUs. There are several configurations to use this implementation, including standard cluster (where you have full control) and autopilot cluster (where Google does the heavy configs for you). I've been exploring the capabilities and in this blog we will explore setting up for autopilot clusters.
#### Autopilot and managed DRANET
GKE autopilot is a managed version of GKE that handles nodes, scaling, security, and other preconfigured settings. GKE managed DRANET lets you request and allocate networking resources for your Pods, including network interfaces that support TPUs and Remote Direct Memory Access (RDMA).
#### Setup flow
To deploy your GKE autopilot cluster and enable managed DRANET, you need to create a Virtual Private Cloud (VPC) . Let's walk through the setup:
- Deploy an Autopilot cluster.
- Create a custom ComputeClass which supports the accelerator type (TPU or GPU)
- Create a ResourceClaimTemplate for GPUs (RDMA) or non-GPU (TPU)
- Deploy workload and reference the ComputeClass and ResourceClaimTemplate to get the correct networking set up.
Now let's explore the configs for both TPU and GPU.
Configure variables:
Loading...
export PROJECT_ID=$(gcloud config get project) #automatically sets your Project_ID export REGION="REGION" export CLUSTER_NAME="CLUSTER_NAME" export NETWORK="NETWORK" export SUBNETWORK="SUBNETWORK" export RESERVATION_URL="RESERVATION_URL" export HF_TOKEN="HUGGING_FACE_TOKEN"
Replace the following:
- REGION : The region where you want to create your cluster, such as us-east1 . You can only create the cluster in the region where your reservation or resources exists.
- CLUSTER_NAME : A name for your cluster, such as dranet-cluster .
- NETWORK : The name of the VPC network.
- SUBNETWORK : The name of the subnet in the VPC.
- RESERVATION_URL : The URL of the reservation that you want to use to create your resources.
- HUGGING_FACE_TOKEN : The Hugging Face access token to download your model.
#### 1. Deploy an Autopilot cluster
Deploy an Autopilot cluster .
gcloud container clusters create-auto $CLUSTER_NAME \ --project=$PROJECT_ID \ --region=$REGION \ --release-channel=rapid \ --network=$NETWORK \ --subnetwork=$SUBNETWORK
#### 2. Create a custom ComputeClass
Example: GPU B200 custom ComputeClass with managed DRANET support and a reservation.
apiVersion: cloud.google.com/v1 kind: ComputeClass metadata: name: dranet-a4-computeclass spec: nodePoolAutoCreation: enabled: true nodePoolConfig: dra: networking: enabled: true priorities: - machineType: a4-highgpu-8g gpu: count: 8 type: nvidia-b200 acceleratorNetworkProfile: auto reservations: affinity: Specific specific: - name: ${RESERVATION_URL} project: ${PROJECT_ID}
- ${RESERVATION} : With the URL of the reservation that you want to use to create your resources.
- ${PROJECT_ID}: With the ID of the project you are using.
Alternatively you can set the variables in your terminal and use the following command to pass the variables at creation envsubst < filename.yaml | kubectl apply -f -
Example: TPU v6e custom ComputeClass using on-demand example.
apiVersion: cloud.google.com/v1 kind: ComputeClass metadata: name: dra-gke-auto spec: nodePoolAutoCreation: enabled: true nodePoolConfig: dra: networking: enabled: true priorities: - tpu: type: tpu-v6e-slice count: 8 topology: "2x4" acceleratorNetworkProfile: auto location: zones: - us-east5-b
#### 3. Create a ResourceClaimTemplate
RDMA support deviceClassName: mrdma.google.com ResourceClaimTemplate example for GPUs:
apiVersion: resource.k8s.io/v1 kind: ResourceClaimTemplate metadata: name: all-mrdma spec: spec: devices: requests: - name: req-mrdma exactly: deviceClassName: mrdma.google.com allocationMode: All
Non-RDMA deviceClassName: netdev.google.com ResourceClaimTemplate example for TPUs.
apiVersion: resource.k8s.io/v1 kind: ResourceClaimTemplate metadata: name: all-netdev spec: spec: devices: requests: - name: req-netdev exactly: deviceClassName: netdev.google.com allocationMode: All
#### 4. Deploy workload and reference ComputeClass and ResourceClaim
Create a secret in your cluster
kubectl create secret generic hf-secret \ --from-literal=hf_token=${HF_TOKEN}
Example deploying GPUs
apiVersion: apps/v1 kind: Deployment metadata: name: gemma-4-31-deploy spec: replicas: 2 selector: matchLabels: app: gemma4 template: metadata: labels: app: gemma4 ai.gke.io/model: gemma-4-31b ai.gke.io/inference-server: vllm spec: resourceClaims: - name: rdma-claim resourceClaimTemplateName: all-mrdma containers: - name: vllm-inference image: us-docker.pkg.dev/vertex-ai/vertex-vision-model-garden-dockers/pytorch-vllm-serve:gemma4 resources: requests: cpu: "10" memory: "1000Gi" ephemeral-storage: "1Ti" nvidia.com/gpu: "8" limits: cpu: "10" memory: "1000Gi" ephemeral-storage: "1Ti" nvidia.com/gpu: "8" claims: - name: rdma-claim command: ["python3", "-m", "vllm.entrypoints.openai.api_server"] args: - --model=$(MODEL_ID) - --tensor-parallel-size=8 - --host=0.0.0.0 - --port=8000 - --max-model-len=131072 - --max-num-seqs=16 - --enable-chunked-prefill - --gpu-memory-utilization=0.90 env: - name: MODEL_ID value: google/gemma-4-31B - name: HUGGING_FACE_HUB_TOKEN valueFrom: secretKeyRef: name: hf-secret key: hf_token volumeMounts: - mountPath: /dev/shm name: dshm startupProbe: httpGet: path: /health port: 8000 failureThreshold: 240 periodSeconds: 10 livenessProbe: httpGet: path: /health port: 8000 periodSeconds: 10 readinessProbe: httpGet: path: /health port: 8000 periodSeconds: 5 volumes: - name: dshm emptyDir: medium: Memory nodeSelector: cloud.google.com/compute-class: dranet-a4-computeclass
Notice how the deployment references the ResourceClaimTemplate and ComputeClass . When this kicks off, it triggers a scale-up operation. GKE Autopilot reads the ComputeClass to provision the specific node type and to configure managed DRANET networking. Meanwhile, the resource claim acts as the bridge, binding your Pods directly to the accelerators on those nodes. This process works exactly the same for TPUs.
#### Next Steps
Take a deeper dive into GKE managed DRANET and autopilot with these resources:
- Hands-on Lab: GKE Autopilot clusters with TPUs, GKE managed DRANET and Gemma 4
- Document set: DRANET
- Documentation: AI Hypercomputer
Want to ask a question, find out more, or share a thought? Please connect with me on Linkedin .
Posted in
- Developers & Practitioners