In some scenarios, special needs are required, such as GPU capabilities, enhanced network capabilities, high clock speed, and local storage. You can specify Elastic Compute Service (ECS) instance types to create an Elastic Container Instance (ECI). This topic describes how to create an ECI by specifying ECS instance types.

Descriptions of ECS instance types

For detailed information about ECI-specific ECS instance types, see the descriptions of ECS instance types. The unit price of ECI is the same as that of the corresponding ECS instance type. Both are billed on a per-second basis. For more information, see ECS price calculator.

You can check the ECS instance types supported by each region and zone in Overview of ECS instance types available to purchase in each region and zone. Currently, the supported ECS instance families include the following.

  • g6 and g5, general purpose instance families (the CPU-to-memory ratio is 1:4). sn2ne, general purpose instance family (the CPU-to-memory ratio is 1:4) with enhanced network performance
  • c6 and c5, compute optimized instance families (the CPU-to-memory ratio is 1:2). sn1ne: compute optimized instance family (the CPU-to-memory ratio is 1:2) with enhanced network performance
  • r6 and r5, memory optimized instance families (the CPU-to-memory ratio is 1:8). sn1ne, memory optimized instance family (the CPU-to-memory ratio is 1:8) with enhanced network performance
  • ic5, compute intensive instance family (the CPU-to-memory ratio is 1:1)
  • hfc6 and hfc5, compute optimized instance families with high clock speed (the CPU-to-memory ratio is 1:2)
  • hfg6 and hfg5, general purpose instance families with high clock speed (the CPU-to-memory ratio is 1:4)
  • gn6i, gn6v, gn5i, and gn5, compute optimized instance families with GPU capabilities (local storage is not supported)
  • t5 and t6, burstable instance families

Examples

You can set annotations: k8s.aliyun.com/eci-use-specs in the definition of a pod to specify multiple ECS instance types. Separate ECS instance types with commas (,).

apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
      annotations:
        k8s.aliyun.com/eci-instance-type : "ecs.c5.large"# Replace with the ECS instance types as needed.
    spec:
      containers:
      - name: nginx
        image: nginx:1.7.9
        ports:
        - containerPort: 80