All Products
Search
Document Center

Container Compute Service:Create a Job

Last Updated:Jan 22, 2026

A Job is used to run short-lived, one-off tasks, and ensures that one or more Pods run to completion. In an ACS cluster, you can create a Job workload in the console. This topic describes how to create a Job workload.

Background information

Jobs can be categorized into the following types based on the settings for .spec.completions (the number of Pods that must run to completion, default: 1) and .spec.parallelism (the maximum number of Pods that can run in parallel, default: 1):

Job type

Completions

Parallelism

Use case

Behavior

Non-parallel Job

1

1

Database migration

Runs one Pod until it successfully terminates.

Job with a fixed completion count

2+

1

Process a work queue

Pods are run sequentially until the number of successful completions reaches the value of completions.

Parallel Job with a work queue

1

2+

Multiple Pods process a work queue simultaneously without a required number of completions.

Multiple Pods run in parallel until any one of them successfully terminates.

Parallel Job with a fixed completion count

2+

2+

Multiple Pods process a work queue simultaneously with a required number of completions.

Multiple Pods run in parallel until the number of successful completions reaches the value of completions.

Procedure

Step 1: Configure basic information

  1. Log on to the ACS console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of the target cluster, or click Details in the Actions column.

  3. In the left navigation pane of the cluster management page, choose Workloads > Jobs.

  4. On the Jobs page, click Create from Image.

  5. On the Basic Information creation wizard, configure the basic information about the application.

    Parameter

    Description

    Name

    Enter a name for the application.

    Type

    Set to Job.

    Label

    Add labels to the application. The labels are used to identify the application.

    Annotations

    Add annotations to the application.

    Instance Type

    Select an instance type.

    QoS Type

    Select a QoS class. For more information, see QoS classes.

    • General-purpose pods support the default and best-effort QoS classes.

    • Performance-enhanced pods support only the default QoS class.

  6. After you complete the basic settings, click Next.

Step 2: Configure containers

  1. On the Container page of the wizard, configure the container settings.

    Note

    To the right of the Container1 tab, Add Container to add multiple containers to the Pod.

    1. Configure the basic settings for the container.

      Parameter

      Description

      Image Name

      • Select image

        Click Select images to select an image.

        • Container Registry Enterprise Edition: Select an Enterprise Edition image that is hosted in an Alibaba Cloud Container Registry (ACR) instance. You must select the region and the ACR instance where the image is stored. See What is Container Registry?

        • Container Registry Personal Edition: You must activate this service first. Select a Personal Edition image that is hosted in an ACR instance. You must select the region and the ACR instance where the image is stored.

        • Artifact Center: This repository contains base OS images, base language images, and images related to AI and big data. This topic uses an Nginx image from the Artifact Center as an example. See Artifact Center.

      • Image Pull Policy

        ACS supports only the Always pull policy. This means that the image is always re-pulled from the container registry during each deployment or scaling operation, and is never pulled from the local cache.

      • Set Image Pull Secret

        Click Set Image Pull Secret to configure a secret for your private image to ensure security.

      Required Resources

      Set resource limits for the container.

      • CPU: Specify the CPU request and limit for the container. By default, the CPU request is equal to the CPU limit. The resource is billed on a pay-as-you-go basis. If you set a different CPU limit from the CPU request by using YAML, the CPU request is automatically changed to be the same as the CPU limit. See Resource specifications.

      • Memory: Specify the memory request and limit for the container. By default, the memory request is equal to the memory limit. The resource is billed on a pay-as-you-go basis. If you set a different memory limit from the memory request by using YAML, the memory request is automatically changed to be the same as the memory limit. For more information, see Resource specifications.

      Interactive Session

      (Optional) Configure startup commands for the container.

      • stdin: Sends console input to the container.

      • tty: Allocates a pseudo-TTY for the container.

      Note

      Typically, stdin and tty are selected together to attach the terminal (tty) to the standard input (stdin) of the container.

      For example, this is required for an interactive program that gets standard input from a user and displays output on the terminal.

      Init Containers

      (Optional) Select this option to create an init container.

      Init containers provide a mechanism to block or delay the startup of application containers. After the init containers run to completion, the application containers in the Pod start in parallel.

      For example, use init containers to check the availability of dependent services. Init containers can include utilities or setup scripts that are not present in an app image. Use them to initialize the runtime environment for application containers, such as setting kernel parameters or generating configuration files. See Init Containers.

    2. (Optional) In the Ports section, click Add to configure ports for the container.

    3. (Optional) In the Environments section, click Add to configure environment variables.

      Configure environment variables for the Pod as key-value pairs. Doing so lets you add environment flags to the Pod or pass configurations. See Pod variables.

    4. (Optional) In the Lifecycle section, configure the container's lifecycle.

      You can configure post-start and pre-stop handlers for the container. See Attach Handlers to Container Lifecycle Events.

      • Start: Sets the command and arguments to be executed when the container starts.

      • Post Start: Sets the command to be executed immediately after a container is created.

      • Pre Stop: Sets the command to be executed immediately before a container is terminated.

    5. (Optional) In the Volume section, mount volumes for the container.

      You can configure local storage and cloud storage.

      • Local storage: Mount resources such as ConfigMaps, Secrets, and temporary directories (emptyDir) to paths inside the container. See Volumes.

      • Cloud storage: Supports storage types such as cloud disks and NAS. See Storage overview.

  2. After you configure the container, click Next.

Step 3: Configure advanced settings

  1. In the Job Settings section, configure the job.

    Parameter

    Description

    Completions

    This corresponds to the completions field, which specifies the number of Pods that must run to completion. The default value is 1.

    Parallelism

    This corresponds to the parallelism field, which specifies the maximum number of Pods that can run concurrently at any given time. The default value is 1.

    Timeout

    This corresponds to the activeDeadlineSeconds field. It specifies the duration for which the Job can run. If the Job is still running after this duration, the system attempts to terminate it.

    BackoffLimit

    The number of times to retry creating a Pod after it fails. The default is 6. The delay before each retry increases exponentially, up to a maximum of 6 minutes.

    Restart

    Only Never and OnFailure are supported.

  2. (Optional) In the Labels,Annotations section, click Add to set labels and annotations for the Pod.

  3. Click Create Now.

    After the Job is created, you are redirected to a page that shows the objects contained in the application. You can view information about the Job on the Jobs page.

Related operations

On the Jobs page, click the name of the destination application or click Details in its Actions column. On the application details page, you can click Scale or View YAML.

  • Scale: On the application details page, click Scale to modify the desired number of Pods.

  • View YAML: On the application details page, click View YAML.