Create a pod using an Arm instance type
This topic shows you how to create an ECI pod for the Arm architecture by specifying an ECS Arm instance type. The pod runs on a virtual node based on the Arm architecture.
Prerequisites
You have created an Arm-based virtual node in your cluster. For more information, see Add an Arm-based virtual node.
Instance types
For more information about ECS instance types, see the following topics:
Configuration
To create a pod using an Arm instance type, you must add the k8s.aliyun.com/eci-use-specs annotation to the pod's metadata to specify the instance type and set the nodeSelector to kubernetes.io/arch: arm64 to schedule the pod to a node with the Arm architecture.
The following steps show how to configure the pod.
-
Verify that an Arm-based virtual node exists in the cluster.
kubectl get nodeIf the output includes a node name ending with the
linux-arm64suffix, that node is an Arm-based virtual node.:~$ kubectl get node NAME STATUS ROLES AGE VERSION virtual-kubelet-cn-beijing-h Ready agent 169m v1.24.6-aliyun.1 virtual-kubelet-cn-beijing-i Ready agent 169m v1.24.6-aliyun.1 virtual-kubelet-cn-beijing-i-linux-arm64 Ready agent 75s v1.24.6-aliyun.1 virtual-kubelet-cn-beijing-k Ready agent 169m v1.24.6-aliyun.1NoteTo learn how to create an Arm-based virtual node, see Add an Arm-based virtual node.
-
Create a pod and specify an Arm instance type.
kubectl create -f arm-test.yamlThe following is an example arm-test.yaml file:
apiVersion: apps/v1 kind: Deployment metadata: name: test labels: app: test spec: replicas: 1 selector: matchLabels: app: nginx template: metadata: name: nginx-test labels: app: nginx alibabacloud.com/eci: "true" annotations: k8s.aliyun.com/eci-use-specs: "ecs.c8y.large,ecs.g8y.large" # Specifies the ECS Arm instance types. You can list up to five. spec: containers: - name: nginx image: arm64v8/centos:7.9.2009 # An image built for the Arm architecture. command: ["sleep"] args: ["999999"] nodeSelector: kubernetes.io/arch: arm64 # Schedules the pod to a node with the Arm architecture.