All Products
Search
Document Center

Elastic Container Instance:Overview

Last Updated:Jan 15, 2024

Elastic Container Instance can provide basic container runtimes to Kubernetes clusters. Each elastic container instance is a pod. This topic describes how to configure and create an Elastic Container Instance pod. This topic also describes the lifecycle of a pod.

Basic configurations

Elastic Container Instance can be connected to Kubernetes clusters by using virtual nodes. Virtual nodes are created based on the Virtual Kubelet technology that is provided by the Kubernetes community. An Elastic Container Instance pod involves the following configurations:

  • Specifications

    The specifications include vCPUs and memory configurations that define the computing performance of pods. To create a pod, you can specify the specifications of the pod, such as the number of vCPUs and memory size. You can also specify an Elastic Compute Service (ECS) instance type to meet special requirements, such as the requirements for GPUs and local disks.

  • Container images

    A pod can contain up to 20 containers. Before you deploy a container application, you must prepare a container image. A container image contains the programs, library files, and configurations that are required to run containerized applications. Before you pull images, make sure that the network is accessible. We recommend that you use the image cache feature to shorten the startup time of the pod.

  • Networks

    A pod uses one elastic network interface (ENI) of a vSwitch in the virtual private cloud (VPC) to which the pod belongs. By default, a pod is assigned an internal IP address. If a pod needs to access the Internet, for example, if you want to pull public images, you must associate an elastic IP address (EIP) with the pod, or associate a network address translation (NAT) gateway with the VPC to which the pod belongs.

  • Storage

    By default, a pod provides 30 GiB of memory for temporary storage. You can increase the memory size for temporary storage based on your business requirements. If you want to retain the stored files, we recommend that you mount external volumes. You can mount Alibaba Cloud storage volumes, such as disks, Apsara File Storage NAS (NAS) file systems, and Object Storage Service (OSS) buckets.

Creation methods

Overview

You can use different methods to create pods based on your business and usage scenarios. These methods correspond to different billing modes.

Creation method

Billing basis

Description

References

Specify the number of vCPUs and memory size

Based on the vCPU and memory specifications

You are charged for pods based on the vCPU and memory specifications that you specify when you create the pods. For vCPU and memory specifications that are not supported, the system adjusts the instance specifications and charges you based on the new specifications.

Specify an ECS instance type

Based on the ECS instance type

You are charged for pods based on the ECS instance types that you specify when you create the pods. You can specify an ECS instance type as the underlying support of your Elastic Container Instance pod based on your business requirements. This way, the pod can obtain the specific capabilities of the ECS instance type. For example, if you specify the ecs.gn6i-c4g1.xlarge instance type, the pod can obtain the GPU-accelerated capabilities.

Set ECS instance families or instance family generations for filtering while you specify specifications of vCPU and memory.

Based on the ECS instance type

The system automatically selects a suitable ECS instance type based on the specifications of vCPU and memory and the filter conditions for ECS instance families or instance family generations that you specify when you create the pod. You are charged based on the actually used ECS instance type.

Note

For more information, see Billing of elastic container instances.

Optimize usage costs of pods

You can use pay-as-you-go elastic container instances together with preemptible elastic container instances, reserved instances, and savings plans to reduce costs based on your business requirements.

  • Preemptible elastic container instances can be used for stateless and fault-tolerant workloads. For more information, see Create a preemptible elastic container instance.

  • For long-term stable workloads, we recommend that you use reserved instances or savings plans to offset the bills of pods. The following methods can be used to offset your bills based on the billing basis of pods:

    • Pods for which you are charged based on the number of vCPUs and memory size: General-purpose or elastic savings plans can be used.

    • Pods for which you are charged based on ECS instance types: General-purpose savings plans, ECS compute savings plans, and reserved instances can be used.

    You can select an offset method based on your elastic container instances. For more information, see Use reserved instances and Use savings plans.

Respond to insufficient resources

Elastic Container Instance provides cloud resources for containers. When you create a large number of pods, some resources in the specified region and zone may be insufficient. To ensure that the pods can be created, we recommend that you specify multiple pod specifications and multiple vSwitches that are deployed in different zones. For more information, see the following topics:

Manage lifecycle

In the lifecycle of pods, the pods have different status in different stages. For more information about the status of pods in Elastic Container Instance and the corresponding status of Kubernetes pods, see Lifecycle of a pod.