All Products
Search
Document Center

Overview

Last Updated: Sep 08, 2021

After you use Virtual Kubelet to connect Elastic Container Instance to a Kubernetes cluster, you can schedule pods to run on Elastic Container Instance and configure annotations to use the features of Elastic Container Instance.

Schedule pods to Elastic Container Instance

For Serverless Kubernetes (ASK) clusters, the entire clusters run on Elastic Container Instance, so you do not need to schedule pods to Elastic Container Instance. For Kubernetes clusters that use both Elastic Container Instance and regular nodes, you can schedule pods to run on Elastic Container Instance. You can schedule pods to Elastic Container Instance in the following scenarios:

  • Manually schedule pods to Elastic Container Instance

    You can manually schedule pods to run on Elastic Container Instance by configuring namespace labels, pod labels, or Elastic Container Instance elastic scheduling. For more information, see Schedule pods to Elastic Container Instance.

  • Automatically schedule pods to Elastic Container Instance

    Elastic Container Instance profiles provide the Elastic Container Instance Scheduler feature to implement a new scheduling mechanism based on the Mutating Webhook mechanism. You can declare the namespace or pod labels to be matched in Elastic Container Instance profiles. Pods that have the declared labels are automatically scheduled to Elastic Container Instance. For more information, see Configure an Elastic Container Instance profile.

  • Automatically re-schedule pods that fail to be scheduled to Elastic Container Instance

    After the virtual-kubelet-autoscaler add-on is deployed in Container Service for Kubernetes (ACK) clusters, the add-on automatically re-schedules pods that fail to be scheduled due to insufficient ACK resources to Elastic Container Instance. For more information, see Install the virtual-kubelet-autoscaler add-on in an ACK cluster.

  • Automatically schedule pods with elastic workloads to ECI

    After the ack-kubernetes-elastic-workload add-on is deployed in an ACK cluster, the add-on controls the fine-grained distribution of loads such as Deployment and StatefulSet at the pod level. The add-on schedules the scaled-out pods to run on Elastic Container Instance to implement a more fine-grained scheduling policy. For more information, see Deploy and use ack-kubernetes-elastic-workload in an ACK cluster.

Use features of Elastic Container Instance

When you schedule pods of a Kubernetes cluster to Elastic Container Instance, you can add annotations to the pods to make full use of the features of Elastic Container Instance. Make sure that the annotations that you want to add comply with the Kubernetes syntax. Annotations must be added to the metadata of pods. The following table describes common annotations:

Note

You can manually add annotations when you schedule pods. Alternatively, you can configure an Elastic Container Instance profile. Then, you can use the Elastic Container Instance Effect feature of the Elastic Container Instance profile to automatically append annotations to pods that have the labels. For information about how to configure Elastic Container Instance Effect, see Configure an Elastic Container Instance profile.

Annotation

Example

Description

k8s.aliyun.com/eci-vswitch

vsw-bp1xpiowfm5vo8o3c****

Specifies the IDs of vSwitches. You can specify multiple vSwitches to specify multiple zones.

k8s.aliyun.com/eci-use-specs

2-4Gi,4-8Gi,ecs.c6.xlarge

Specifies the elastic container instance types. You can specify multiple elastic container instance types. An elastic container instance type can be a combination of vCPUs and memory or an ECS instance type.

k8s.aliyun.com/eci-image-cache

"true"

Specifies whether to automatically match the image cache.

k8s.aliyun.com/eci-with-eip

"true"

Specifies whether to automatically create and associate an Elastic IP Address (EIP).

For information about annotations supported by Elastic Container Instance and configuration examples of the annotations, see Pod annotations supported by Elastic Container Instance.

Note

If exceptions occur when you use the features of Elastic Container Instance, you can view the event information. For more information, see Custom events of Elastic Container Instance.