This page shows you how to configure your Google Kubernetes Engine (GKE) Autopilot deployments to request nodes that are backed by Arm architecture.
About Arm architecture in Autopilot
Autopilot clusters offer
for workloads that have specific hardware requirements. Some of these compute
classes support multiple CPU architectures, such as
Use cases for Arm nodes
Nodes with Arm architecture offer more cost-efficient performance than similar x86 nodes. You should select Arm for your Autopilot workloads in situations such as the following:
- Your environment relies on Arm architecture for building and testing.
- You're developing applications for Android devices that run on Arm CPUs.
- You use multi-arch images and want to optimize costs while running your workloads.
How to request Arm nodes in Autopilot
To request Arm nodes for your Pods, you must request nodes with the Arm architecture and request a compute class that supports Arm nodes. The following sections show you how to request the compute class and Arm architecture using a node selector or a node affinity rule in your Pod specification.
For a list of compute classes that support Arm architecture, refer to Compute classes in Autopilot.
Before you begin
Before you start, make sure you have performed the following tasks:
- Enable the Google Kubernetes Engine API. Enable Google Kubernetes Engine API
- If you want to use the Google Cloud CLI for this task, install and then initialize the gcloud CLI.
- Ensure that you have a GKE Autopilot cluster
running GKE version 1.24.1-gke.1400 or later. To set the
version, use the
--cluster-versionflag in your create or upgrade command.
- Ensure that you have quota for the
T2ACompute Engine machine type.
- Ensure that you have a Pod with a container image that's built for Arm architecture.
Request a compute class and Arm architecture
cloud.google.com/compute-class: COMPUTE_CLASS kubernetes.io/arch: arm64
COMPUTE_CLASS with the name of a compute
class that supports the Arm architecture, such as
When you deploy your workload, Autopilot does the following:
- Automatically provisions Arm nodes to run your Pods.
- Automatically taints the new nodes to prevent non-Arm Pods from being scheduled on those nodes.
- Automatically adds a toleration to your Arm Pods to allow scheduling on the new nodes.
You can also request Arm architecture for Spot Pods.
Example request for Arm architecture
The following example specifications show you how to use a node selector or a node affinity rule to request Arm architecture in Autopilot.
The following example manifest shows you how to request Arm nodes in a nodeSelector:
apiVersion: apps/v1 kind: Deployment metadata: name: nginx-arm spec: replicas: 3 selector: matchLabels: app: nginx-arm template: metadata: labels: app: nginx-arm spec: nodeSelector: cloud.google.com/compute-class: Scale-Out kubernetes.io/arch: arm64 containers: - name: nginx-arm image: nginx resources: requests: cpu: 2000m memory: 2Gi
You can use node affinity to request Arm nodes. You can also specify the type of node affinity to use:
requiredDuringSchedulingIgnoredDuringExecution: Must use the specified compute class and architecture.
preferredDuringSchedulingIgnoredDuringExecution: Use the specified compute class and architecture on a best-effort basis. For example, if an existing x86 node is allocatable, GKE places your Pod on the x86 node instead of provisioning a new Arm node. Unless you're using a multi-arch image manifest, your Pod will crash. We strongly recommend that you explicitly request the specific architecture that you want.
The following example manifest requires the
Scale-Out class and Arm
apiVersion: apps/v1 kind: Deployment metadata: name: nginx-arm spec: replicas: 3 selector: matchLabels: app: nginx-arm template: metadata: labels: app: nginx-arm spec: terminationGracePeriodSeconds: 25 containers: - name: nginx-arm image: nginx resources: requests: cpu: 2000m memory: 2Gi ephemeral-storage: 1Gi affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: cloud.google.com/compute-class operator: In values: - Scale-Out - key: kubernetes.io/arch operator: In values: - arm64
- Build and use multi-arch images as part of your pipeline. Multi-arch images ensure that your Pods run even if they're placed on x86 nodes.
- Explicitly request architecture and compute classes in your workload manifests. If you don't, Autopilot uses the default architecture of the selected compute class, which might not be Arm.
You can deploy Autopilot workloads on Arm architecture in the following Google Cloud regions:
For common errors and troubleshooting information, refer to Troubleshooting Arm workloads.
- Learn more about Autopilot cluster architecture.
- Learn about the lifecycle of Pods.
- Learn about the available Autopilot compute classes.
- Read about the default, minimum, and maximum resource requests for each platform.