Schedule workloads to ARM nodes
By default, Container Service for Kubernetes (ACK) schedules all workloads to x86 worker nodes. If your cluster has both ARM and non-ARM nodes, such as x86 nodes, use native Kubernetes scheduling configurations. These configurations run ARM-only workloads on ARM nodes and preferentially schedule multi-architecture images to ARM nodes.
Prerequisites
-
An ACK cluster that runs Kubernetes 1.20 or later is created, and the operating system of the cluster is Alibaba Cloud Linux 3. For more information, see Create a cluster and Upgrade clusters.
Note-
On the Add-ons page of the ACK console, only add-ons in the Core Components, Logs and Monitoring, Volumes, and Network categories are supported in ARM node pools.
-
Add-ons in the App Marketplace are not supported in ARM node pools.
-
-
The kube-scheduler add-on is installed. For more information, see Components.
Usage notes
If both ARM-based nodes and x86-based nodes exist in your cluster, we recommend that you add the kubernetes.io/arch=arm64:NoSchedule taint to ARM-based nodes. This avoids accidentally scheduling applications or components that do not support the ARM architecture to ARM-based nodes. When you configure nodeSelector or nodeAffinity to schedule applications to ARM-based nodes in an ACK cluster that runs a Kubernetes version earlier than 1.24, you need to add a toleration to tolerate the kubernetes.io/arch=arm64:NoSchedule taint. However, if the cluster runs Kubernetes 1.24 or later, the scheduler automatically tolerates the kubernetes.io/arch=arm64:NoSchedule taint. In this case, you do not need to add a toleration to tolerate the taint.
Billing
For more information about ARM-based ECS instance types and pricing, see:
Create an ARM cluster or node pool
Add ARM nodes when creating an ACK cluster to create a cluster that contains only ARM nodes, or create an ARM node pool in an existing cluster.
Add during cluster creation
During node pool configuration when you create a cluster, in the Instance Type section, set Architecture to Arm. Select the required instance type, configure other parameters as needed, and create the cluster. For more information about cluster creation settings, see Create an ACK managed cluster.
-
ARM instances are available only in specific regions and zones. Make sure that your cluster is in a supported region. To check the regions and zones where ARM instances are available, see Instance types available for each region.
-
Available ARM compute instance families include:
Create a node pool
During node pool creation, in the Instance Type section, set Architecture to Arm. Select the required instance type, configure other parameters as needed, and create the node pool. For more information about node pool creation settings, see Create and manage node pools.
-
ARM instances are available only in specific regions and zones. Make sure that your cluster is in a supported region. To check the regions and zones where ARM instances are available, see Instance types available for each region.
-
Available ARM compute instance families include:
Schedule ARM-only workloads to ARM nodes
If your cluster has both ARM and non-ARM nodes and your application supports only the ARM architecture, run the application on ARM nodes. Otherwise, its pods might be scheduled to non-ARM nodes and fail to start. All ARM nodes have the kubernetes.io/arch=arm64 label by default. Use either nodeSelector or nodeAffinity to deploy applications to ARM nodes.
nodeSelector
Add the following constraint to a pod and use nodeSelector to schedule the pod to ARM nodes. nodeSelector restricts this workload to nodes with the arm64 label. All ARM nodes in ACK clusters have this label.
nodeSelector:
kubernetes.io/arch: arm64 # Specify an ARM node.
The following sample code deploys a stateless application to an ARM node.
nodeAffinity
Add the following constraint to a pod and use node affinity to deploy the application to ARM nodes. This constraint specifies that the pod can be scheduled only to nodes with the kubernetes.io/arch=arm64 label.
When a pod spec contains this constraint, the scheduler automatically tolerates the node taint kubernetes.io/arch=arm64:NoSchedule.
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- arm64
The following sample code deploys a stateless application to an ARM node.
Schedule multi-architecture images to ARM nodes
By default, an ACK cluster schedules all workloads to x86 nodes and keeps waiting for x86 node resources when those resources are insufficient. If your application image is a multi-architecture image that supports both x86 and ARM, configure node scheduling across x86 and ARM architectures.
For example, configure node affinity to preferentially schedule workloads to ARM or x86 nodes. If resources of the preferred node type are insufficient, the scheduler attempts to schedule the workloads to nodes of the other architecture.
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- arm64
Prefer ARM architecture
Prefer x86 architecture
FAQ
Can I use ARM-based spot instances?
ARM-based spot instances are available. For instructions, see Use preemptible instances.
What are the limitations of using ARM nodes in ACK clusters?
For the ARM architecture, the Add-ons page of the ACK console supports only the following add-ons:
-
Core Components
-
Logs and Monitoring
-
Storage
-
Networking
Add-ons in the App Marketplace do not support ARM.
References
-
Alternatively, create ARM virtual nodes and configure workloads to be preferentially scheduled to ARM nodes. For more information, see Schedule workloads to Arm virtual nodes.
-
Use Container Registry Enterprise Edition (ACR EE) to build multi-architecture container images. For more information, see Build multi-architecture container images.
-
If you have big data workloads and do not want to manage underlying cluster resources, you can Run Spark jobs on ARM-based virtual nodes.