In some scenarios, you may have special requirements on specifications, such as GPUs, enhanced network capabilities, high clock speeds, and local disks. To meet the requirements, you can create an Elastic Container Instance (ECI) of the specified Elastic Compute Service (ECS) instance type. The instance types of ECIs are defined as the same as the ECS instance types.
Supported ECS instance types
You can check the ECS instance types supported in each region and zone on the ECS Instance Types Available for Each Region page.
Currently, the following instance families are supported. For more information, see Instance families.
General purpose instance families that offer a CPU-to-memory ratio of 1:4: g6, g5, and sn2ne with enhanced network performance
Compute optimized instance families that offer a CPU-to-memory ratio of 1:2: c6, c5, and sn1ne with enhanced network performance
Memory optimized instance families that offer a CPU-to-memory ratio of 1:8: r6, r5, and se1ne with enhanced network performance.
Compute intensive instance family that offers a CPU-to-memory ratio of 1:1: ic5
Compute optimized instance families with high clock speeds that offer a CPU-to-memory ratio of 1:2: hfc6 and hfc5
General purpose instance families with high clock speeds that offer a CPU-to-memory ratio of 1:4: hfg6 and hfg5
Compute optimized instance families with GPU capabilities: gn6i, gn6v, gn5i, and gn5 that supports local storage
Burstable instance families: t6 and t5
Alibaba Cloud Container Service for Kubernetes supports creating an ECI of the specified ECS instance type.
- Log on to the Container Service console. In this example, choose Applications > Deployments
in the left-side navigation pane.
- In the upper-right corner of the Deployments page, click Create from Template.
- Add annotations in the pod template.
Notice You need to add annotations in the metadata parameter for the pod.
apiVersion: apps/v1beta2 # For versions earlier than 1.8.0, use apps/v1beta1. kind: Deployment metadata: name: nginx-deployment-basic labels: app: nginx spec: replicas: 2 selector: matchLabels: app: nginx template: metadata: labels: app: nginx annotations: k8s.aliyun.com/eci-use-specs : "ecs.c5.large" # Replace the ECS instance type as needed. spec: # nodeSelector: # env: test-team containers: - name: nginx image: nginx:1.7.9 # Replace it with your image name, in the format of <image_name:tags>. ports: - containerPort: 80
View the created pod
When you call the CreateContainerGroup operation to create an ECI, you can specify multiple instance types through the InstanceType parameter. For more information about other parameters, see CreateContainerGroup.
The following table describes the parameter that you need to set in the request.
|InstanceType||String||No||ecs.c5.xlarge||The instance type of the ECI to be created. You can specify up to five instance types separated with commas (,). Example: ecs.c5.xlarge,ecs.g5.xlarge.|