All Products
Search
Document Center

Elastic container instance lifecycle

Last Updated: Oct 27, 2021

This topic describes different states in the lifecycle of an elastic container instance. You can design and implement your business logic based on the states. Elastic Container Instance is seamlessly connected to Kubernetes. You can directly use elastic container instances as pods in Kubernetes clusters.

Elastic container instance states

The following table describes the states of an elastic container instance during its lifecycle.

State

Description

Scheduling

The elastic container instance is being created.

Pending

One or more containers in the elastic container instance are being started, and no containers are running.

Running

All containers in the elastic container instance are created, and at least one container is running or restarting.

Restarting

The elastic container instance is restarting.

Updating

The elastic container instance is being updated.

Terminating

The elastic container instance is being terminated. A running instance configured with preStop enters the Terminating state when the instance is being deleted. After you run preStop function, the instance is deleted.

Succeeded

All containers in the elastic container instance are terminated after successful runs and not about to restart.

Failed

All containers in the elastic container instance are terminated, and at least one container is terminated due to runtime errors, which indicates that the container exits with a non-zero status or is terminated by the system.

Expired

The elastic container instance is a preemptible instance and is terminated due to resource expiration and recycling.

ScheduleFailed

The elastic container instance failed to be created. The system deletes the elastic container instance after 24 hours, and you are not charged for the elastic container instance.

Notice

The restart policy of an elastic container instance applies only to containers within the elastic container instance. The elastic container instance itself does not automatically restart.

The following figure shows the state transition of an elastic container instance during its lifecycle.Elastic container instance lifecycle

Container states

State

Description

Waiting

The container creation is pending.

Typically, application containers remain in the Waiting state when an InitContainer is running until the InitContainer exits.

Running

The container is created and running.

Terminated

The container is terminated and exits after a successful or failed run.