An elastic container instance comes with vCPU, memory, and network resources. Each elastic container instance is a container group and can be 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. Before you deploy containerized applications, you must prepare container images. 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 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 an elastic container instance needs to access the Internet, for example, to pull public images, you must associate an elastic IP address (EIP) with the elastic container instance, or associate a 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, 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. For more information about billing, see Billing of elastic container instances.
Creation method | Billing | References |
Specify the number of vCPUs and memory size | You are charged for pods based on the vCPU and memory specifications that you specify when you create the pods. You can also specify a compute category based on your cost and performance requirements. 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 | 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. |
An elastic container instance uses the x86 CPU architecture by default and supports the Arm architecture. For information about how to create an Arm-based elastic container instance, see Create an Arm-based instance.
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 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 basis of elastic container instances:
Elastic container instances for which you are charged based on the number of vCPUs and memory size: General-purpose 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 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 elastic container instances, specific resources in the specified region and zone may be insufficient. To ensure that the elastic container instances can be created, we recommend that you specify multiple instance specifications across multiple zones. 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 statuses of the instances to ensure business robustness and prevent waste of resources. For more information, see Lifecycle of an elastic container instance.
Instance management
To facilitate subsequent operations such as filtering, you can add tags to elastic container instances that are used to serve the same management or business purpose. For more information, see Use tags to manage elastic container instances.