All Products
Search
Document Center

Elastic Container Instance:Overview

Last Updated:Jan 15, 2024

An elastic container instance comes with vCPU, memory, and network resources. Each elastic container instance is a container group and is used to run one or more containers. This topic describes the basic configurations, creation methods, and lifecycle of an elastic container instance.

Basic configurations

Elastic Container Instance provides various types of instances with different configurations of vCPU, memory, container image, network, and storage. You can customize and change the configurations of elastic container instances. You have full control over elastic container instances and do not need to manage or configure underlying servers. You only need to provide packaged container images to run containers.

  • Instance specifications

    An elastic container instance mainly consists of vCPUs and memory. When you create an elastic container instance, you can specify the elastic container instance specifications, 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 those for GPU and enhanced network performance.

  • Container images

    An elastic container instance contains one or more containers. You must prepare container images before you deploy containerized applications. A container image includes the programs, library files, and configurations that are required to run containerized applications. You must make sure that the network is accessible before you pull images. We recommend that you use the image cache feature to shorten the startup time of the instance.

  • Networks

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

  • Storage

    By default, an elastic container instance 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 two methods to create elastic container instances based on your business and usage scenarios. These methods correspond to different billing modes.

Creation method

Billing

References

Specify the number of vCPUs and memory size

You are charged for elastic container instances based on the vCPU and memory specifications that you specify when you create the elastic container instances. For vCPU and memory specifications that are invalid, the system adjusts the instance specifications and then charges you based on the new specifications.

Specify an ECS instance type

You are charged for elastic container instances based on the ECS instance types that you specify when you create the elastic container instances. When you create elastic container instances, you can specify ECS instance families based on your business requirements. For example, you can specify the ecs.sn1ne instance family to create elastic container instances that provide enhanced network performance.

Note

For more information about billing, see Billing of elastic container instances.

Reduce costs

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

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

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

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

    • Elastic container instances 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 a suitable method to offset the bills for 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 numerous elastic container instances, some resources in the specified region and zone may be insufficient. We recommend that you specify multiple ECS instance types across multiple zones to ensure that the elastic container instances can be created. For more information, see the following topics:

Lifecycle

If you do not connect Elastic Container Instance to Kubernetes clusters, you must manage the lifecycle of elastic container instances and process business workloads based on the status of the instances to ensure business robustness and prevent the waste of resources. For more information, see Lifecycle of an elastic container instance.

Instance management

You can add tags to elastic container instances that are used to serve the same management or business purpose. These tags facilitate filtering and operations in the future. For more information, see Use tags to manage elastic container instances.