Create an ARM node pool and schedule workloads to ARM nodes

更新时间:
复制 MD 格式

By default, ACK schedules all workloads to x86 worker nodes. In a mixed cluster with both ARM and non-ARM nodes, use Kubernetes scheduling settings to run ARM-only workloads on ARM nodes or preferentially schedule multi-arch images to ARM nodes.

Prerequisites

Usage notes

If your ACK cluster contains both Arm and x86 nodes, add the kubernetes.io/arch=arm64:NoSchedule taint to your Arm nodes. This prevents applications and components that do not support the Arm architecture from being mistakenly scheduled to them. If your cluster runs a version earlier than Kubernetes v1.24, you must also declare a toleration for the kubernetes.io/arch=arm64:NoSchedule taint when you use nodeSelector or nodeAffinity to schedule applications to Arm nodes. To do this, add the corresponding tolerations key for the kubernetes.io/arch=arm64:NoSchedule taint. For clusters that run Kubernetes v1.24 or later, the scheduler automatically recognizes the kubernetes.io/arch=arm64:NoSchedule taint on Arm nodes, so a toleration is not required.

Billing

ARM-based ECS instance types and pricing:

Create an ARM cluster or node pool

Add ARM nodes during cluster creation or add an ARM node pool to an existing cluster.

During cluster creation

In the Instance Type section, set Architecture to Arm, then select instance types and configure other parameters. See Create an ACK managed cluster.

Note

In an existing cluster

In the Instance Type section, set Architecture to ARM, then select instance types and configure other parameters. See Create and manage a node pool.

Note

Schedule ARM-only workloads to ARM nodes

In mixed-architecture clusters, schedule ARM-only applications to ARM nodes to prevent pod failures on incompatible nodes. All ARM nodes carry the label kubernetes.io/arch=arm64. Use nodeSelector or nodeAffinity to target them.

nodeSelector

Add the following nodeSelector to your pod spec. This targets nodes labeled kubernetes.io/arch: arm64, which applies to all ARM nodes in an ACK cluster.

nodeSelector:
  kubernetes.io/arch: arm64 # Specify an ARM node.

Sample YAML to deploy a stateless application to an ARM node:

Example YAML

apiVersion: apps/v1
kind: Deployment
metadata:
  name: only-arm
spec:
  selector:
    matchLabels:
      app: nginx
  replicas: 1
  template:
    metadata:
      labels:
        app: nginx
    spec:
      nodeSelector:
        kubernetes.io/arch: arm64 # Specify an ARM node.
      containers:
      - name: nginx
        image: nginx

nodeAffinity

Use node affinity to schedule pods exclusively to ARM nodes. The following rule targets nodes labeled kubernetes.io/arch=arm64.

With this rule, the scheduler automatically adds a toleration for the kubernetes.io/arch=arm64:NoSchedule taint.

affinity:
  nodeAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
      nodeSelectorTerms:
      - matchExpressions:
        - key: kubernetes.io/arch
          operator: In
          values:
          - arm64

Sample YAML to deploy a stateless application to an ARM node:

Example YAML

apiVersion: apps/v1
kind: Deployment
metadata:
  name: only-arm
spec:
  selector:
    matchLabels:
      app: nginx
  replicas: 1
  template:
    metadata:
      labels:
        app: nginx
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: kubernetes.io/arch
                operator: In
                values:
                - arm64
      containers:
      - name: nginx
        image: nginx

Schedule multi-arch workloads to ARM nodes

By default, ACK schedules workloads to x86 nodes and keeps waiting for x86 node resources even when ARM nodes are available. For multi-arch images, configure scheduling preferences to utilize both architectures.

For example, configure node affinity to prefer ARM or x86 nodes, then fall back to the other architecture when preferred nodes lack resources.

      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - weight: 1
            preference:
              matchExpressions:
              - key: kubernetes.io/arch
                operator: In
                values:
                - arm64

Prefer ARM nodes

Example YAML

apiVersion: apps/v1
kind: Deployment
metadata:
  name: arm-prefer
spec:
  replicas: 1
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
# Preferentially schedule the workload to an ARM node.
      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - weight: 1
            preference:
              matchExpressions:
              - key: kubernetes.io/arch
                operator: In
                values:
                - arm64
      containers:
      - name: my-container
        image: nginx

Prefer x86 nodes

Example YAML

apiVersion: apps/v1
kind: Deployment
metadata:
  name: amd-prefer
spec:
  replicas: 1
  selector:
    matchLabels:
      app: my-app
  template:
    metadata:
      labels:
        app: my-app
    spec:
# Preferentially schedule the workload to an x86 node.
      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - weight: 1
            preference:
              matchExpressions:
              - key: kubernetes.io/arch
                operator: In
                values:
                - amd64
      containers:
      - name: my-container
        image: nginx

FAQ

Can I use ARM-based preemptible instances?

ARM-based preemptible instances are available. See Use preemptible instances.

Limitations of ARM nodes

Currently, only the following Add-on categories support ARM:

  • Core Components

  • Logs and Monitoring

  • Storage

  • Networking

Marketplace components do not support ARM.

References