Updated on 2024-12-17 GMT+08:00

Editing a Batch Deployment Release Task

Edit a batch deployment release task that has not been released based on service changes.

Prerequisites

You have created a batch deployment release task but not released it. For details, see Creating a Batch Deployment Release Task.

Editing a Batch Deployment Release Task

  1. Log in to ServiceStage.
  2. Choose Release Management. The Release Management page is displayed.
  3. Select the target release task in the To release state.

    • Edit directly: Click More > Edit in the Operation column.
    • Edit after confirming the release task details: Click the target release task to go to its Release Management page, confirm the configurations of each component, and click Edit.

  4. Modify the release task by referring to the following table. Parameters marked with an asterisk (*) are mandatory.

    Parameter

    Description

    *Release Task

    Name of a release task.

    Enter 2 to 64 characters. Start with a letter and end with a letter or digit. Only use letters, digits, underscores (_), and hyphens (-).

    Description

    Description of a release task. Enter up to 128 characters.

  5. Set Best Effort Policy.

    • Enable it to continue releasing other components when a component fails to be released.
    • If it is disabled, the release task fails when a component fails to be released.

  6. To delete a component from the release task, click Delete in the Operation column of the target component.
  7. To add a component, click Create Component, set the parameters of the component to be added to the release task by referring to Creating and Deploying a Component Based on a Container Using UI Configurations or Creating and Deploying a Component Based on a VM, and click Create.

    A maximum of 64 components can be created in a batch deployment release task.

  8. Reset the version configurations of each component by referring to the following table.

    Parameter

    Description

    Component

    Component name.

    Enter 2 to 64 characters. Start with a letter and end with a letter or digit. Only use letters, digits, underscores (_), and hyphens (-).

    For container-deployed components:

    • Components with the same name in different applications can be deployed in the same environment.
    • Components with the same name in the same application can be deployed in different CCE clusters in the same HA environment.
    • Components with the same name in the same application can be deployed in different environments.

    For VM-deployed components:

    • Components with the same name in different applications can be deployed in the same environment.
    • Components with the same name in the same application can be deployed in different environments.

    Component Version

    Version number of a component.

    • By default, the version number of the original components in the release task is the original version number of the components, and the version number of the new components in the release task is the time when you perform 7. The format is yyyy.mmdd.hhmms, where s is the ones place of the second in the timestamp. For example, if the timestamp is 2022.0803.104321, the version number is 2022.0803.10431.
    • You can also customize the version number in the format of A.B.C, or A.B.C.D. A. B, C, and D are natural numbers, for example, 1.0.0 or 1.0.0.0.
    NOTE:

    You can perform the following operations to synchronize component versions in batches:

    1. Move the cursor to the Component Version text box of the specified component and click .
    2. Select other components whose versions need to be synchronized.
    3. Click OK.

    Application

    Select the application to which the component belongs. You can perform the following operations to synchronize the applications to which components belong in batches:

    1. Move the cursor to the Application drop-down list of the specified component and click .
    2. Select other components whose applications need to be synchronized.
    3. Click OK.

    Environment

    Select the component deployment environment.

    For container-deployed components, only the Kubernetes environment can be selected. For VM-deployed components, only the VM environment can be selected.

    NOTICE:

    If the component has been bound to a specified microservice engine, distributed cache, or cloud database instance but the specified instance is not bound to the environment selected for the component, an error is reported during advanced settings pre-check.

    You can perform the following operations to synchronize the environments to which components belong in batches:

    1. Move the cursor to the Environment drop-down list of the specified component and click .
    2. Select other components whose environments need to be synchronized.
    3. Click OK.

      After the environment is reset, the cluster to which the container-deployed components belong is changed to the cluster bound to the new environment, and the namespace to which the component belongs is changed to the default namespace of the cluster bound to the new environment.

    Cluster

    Select a CCE cluster for deploying and running the container-deployed component.

    You can perform the following operations to synchronize the clusters to which components belong in batches:

    1. Move the cursor to the Cluster drop-down list of the specified component and click .
    2. Select other components whose clusters need to be synchronized.
    3. Click OK.

      After the cluster is set, the cluster is changed only when the selected cluster is bound to the environment to which the component belongs. In addition, the namespace to which the component belongs is changed to the default namespace of the new cluster.

    Namespace

    Select the namespace of the CCE cluster in the build environment for the container-deployed component to isolate build data. For details, see Managing Namespaces.

    You can perform the following operations to synchronize the namespaces to which components belong in batches:

    1. Move the cursor to the Namespace drop-down list of the specified component and click .
    2. Select other components whose namespaces need to be synchronized.
    3. Click OK.

      After the namespace is set, the namespace is changed only when the selected namespace exists in the cluster to which the component belongs.

    Image Package

    Click , and select the component source again. For details, see Component Source.

    • If you select an image package for a container-deployed component:
      • You can customize the container name. The name contains 1 to 63 characters, including lowercase letters, digits, and hyphens (-), and must start with a lowercase letter and end with a lowercase letter or digit.
      • Click in the upper right corner of the selected image package to change the image package source.
    • If you select a software package for a container-deployed component, you can customize the container name. The name contains 1 to 63 characters, including lowercase letters, digits, and hyphens (-), and must start with a lowercase letter and end with a lowercase letter or digit.
    • If the component source is software package and Custom file address is selected, perform the following operations:
      1. Enter the custom HTTP/HTTPS file download address of the software package.
      2. Determine whether to enable authentication.

        If authentication is disabled, any user can download the software package in the custom file address by default.

        Click to enable authentication. Only authenticated users can download the software package in the custom file address. Authentication mode can be User name and password authentication or User-defined Header Authentication. The authentication mode and the corresponding authentication parameters are determined by the authentication mode supported by the server where the custom file directory is located.

    • For container-deployed components, you can set Image Access Credential. You can select up to 16 image access credentials. Click Create Secret to create an image access credential. Secret Type must be kubernetes.io/dockerconfigjson. For details, see Creating a Secret.

    Instances

    Set the number of running instances of the component.

    • For container-deployed components, the value ranges from 1 to 200. You can perform the following operations to synchronize the number of component instances in batches:
      1. Move the cursor to the Instances text box of the specified component and click .
      2. Select other components whose number of component instances need to be synchronized.
      3. Click OK.
    • For VM-deployed components, you can perform the following operations to reset the number of component instances:
      1. Click Select.
      2. Reselect the number of ECSs for component deployment.

        The ECSs to be selected must have the VM agent installed and be running properly.

        If the status of the target ECS agent indicates that the agent is missing and to install it first, click Install. For details, see 6 to 8 in Installing a VM Agent.

      3. Click OK.

    Deployment Sequence

    Set the deployment sequence of all components to be added to the release task.

    • If the selected components depend on each other, for example, the startup of a component depends on other components, set Deployment Sequence so that the depended components are deployed first.

      For example, for components A, B, and C to be added to the release task, the startup of component A depends on components B and C. Therefore, set Deployment Sequence of components B and C to 1, and set Deployment Sequence of component A to 2.

    • If the components do not depend on each other, retain the default value of Deployment Sequence. All components will be deployed in the same batch.

  9. Reset the component build parameters.

    This parameter is available when the component is deployed based on a container and the technology stack type is Java, Tomcat, Node.js, Python, or PHP.
    1. Locate the target component and click Build in the Operation column.
    2. Set the parameters by referring to the following table. Parameters marked with an asterisk (*) are mandatory.

      Parameter

      Description

      *Command

      If the component source is Source code repository, set Command based on service requirements.

      • Default command or script: preferentially executes build.sh in the root directory. If build.sh does not exist, the code will be compiled using the common method of the selected language. Example: mvn clean package for Java.
      • Custom command: Commands are customized using the selected language. Alternatively, the default command or script is used after build.sh is modified.
        NOTICE:
        • If Custom command is selected, exercise caution when inputting sensitive information in the echo, cat, or debug command, or encrypt sensitive information to avoid information leakage.
        • To run the compilation command in the project subdirectory, you need to go to the project subdirectory and then run other script commands. Example:

          cd ./weather/

          mvn clean package

      *Dockerfile Address

      If the component source is Source code repository, set Dockerfile Address based on service requirements.

      Dockerfile Address is the directory where the Dockerfile is located relative to the root directory (./) of the project. The Dockerfile is used to build an image.

      If Dockerfile Address is not specified, the system searches for the Dockerfile in the root directory of the project by default. If the Dockerfile does not exist in the root directory, the system automatically generates the Dockerfile based on the selected operating environment.

      *Organization

      An organization is used to manage images generated during component build.

      *Build

      Select the type of the environment used to build an image. The build environment must be a Kubernetes environment, and can access the Internet.

      You are advised to select Use current environment. If the CCE cluster in the current environment cannot access the Internet and you have planned an independent build environment, you can select Use independent environment.

      • Use independent environment: Use an independent build environment to build an image. The CCE clusters in the independent build environment and in the current component deployment environment must have the same CPU architecture. Otherwise, the component deployment fails.
      • Use current environment: Use the deployment environment to which the component belongs to build an image. In the current environment, masters and nodes in the CCE cluster must have the same CPU architecture. Otherwise, the component build fails.

      *Environment

      • If Use independent environment is selected for Build, select an independent build environment different from that to which the component belongs.
      • If Use current environment is selected for Build, select the deployment environment to which the component belongs.

      *Select Cluster

      Select a cluster for build if Environment is set to HA Environment.

      For details about the HA environment, see Environment Overview.

      *Namespace

      Select the namespace of the CCE cluster in the environment where the build is executed, which is used to isolate build data. For details, see Managing Namespaces.

      Node Label

      In the following cases, set a node label to deliver the build job to the fixed node bound with an EIP to ensure that the component can be successfully built and deployed:

      • If Use independent environment is selected for Build, set a node label to deliver the build job to the node in the independent environment, to ensure that the node CPU architecture is the same as that of the node in the current component deployment environment.
      • If Use current environment is selected for Build and the CPU architecture of a node is different from that of the master node in the environment, set a node label to deliver the build job to the node that has the same CPU architecture as the master node.

      For details about how to add a label, see Managing Node Labels.

    3. Click OK.

  10. Locate the target component and click Advanced Settings in the Operation column.
  11. Select a component technology stack and version. For details, see Technology Stack.
  12. Set Headless Service Settings for container-deployed stateful components.

    It provides a fixed access domain name for every pod for mutual pod access in a StatefulSet.

    Parameter

    Description

    *Service Name

    Enter the name of the service that can be accessed by external services.

    A service is an abstract method that exposes a group of applications running on a pod as network services.

    NOTE:

    Service names of components deployed on the same CCE must be unique. Otherwise, component deployment will fail.

    *Port Settings

    Set the following port parameters:

    • Port Name: name of the port for communication between pods.
    • Container Port: port used by an application for listening in a container.
    • Access Port: port for accessing the service.

    To add port settings, click Add Setting.

  13. Set Public Network Access.

    • For container-deployed components, go to 14.
    • For VM-deployed components, go to 15.

  14. Click to enable public network access for container-deployed components.

    After public network access is enabled for a component, you can use a public network domain name to access the component through an ELB bound with an EIP to use services provided by the component.
    • After a component with public network access enabled is created and deployed, you can change the configured component access domain name by referring to Changing the Component Access Domain Name.
    • By default, public network access is disabled for a component. After a component is created and deployed, you can also configure the component access mode. For details, see Configuring the Component Access Mode.
    1. Set Public Network Load Balancer.
      • Select a load balancer that has been bound to an EIP in the selected environment.
      • If no load balancer exists, click Add One. On the Edit Environment page that is displayed, click Add Optional Resource to add created load balancers to the environment.
      • To create ELB resources, refer to the following table.

        Scenario

        Reference

        Use the domain name to access an application.

        ELB dark launch

        See Creating a Dedicated Load Balancer.

        • An EIP has been bound to the load balancer and must be in the same VPC and subnet as the compute resources managed in the current component deployment environment.
        • Components must be bound with different load balancers in different deployment environments to avoid route errors.
    2. Set Client Protocol.
      • HTTP has security risks. You are advised to select HTTPS.
      • If HTTPS is selected, click Use existing to select an existing certificate.

        If no certificate exists, click Create new to create a server certificate. For details, see Adding a Certificate.

    3. Set Domain Name.
      • If Automatically generated is selected, the automatically generated domain name is valid only for seven days.
      • If Bound is selected, enter a domain name.
    4. Set Listening Port.

      Enter the listening port number of the application process.

    Figure 1 Configuring public access

  15. Click to enable public network access for VM-deployed components.

    After public network access is enabled for a component, you can use a public network domain name to access the component through an ELB bound with an EIP to use services provided by the component.

    1. Set Public Network Load Balancer.
      • Select a load balancer that has been bound to an EIP in the selected environment.
      • If no load balancer exists, click Add One. On the Edit Environment page that is displayed, click Add Optional Resource to add created load balancers to the environment.
      • To create ELB resources:
        • An EIP has been bound to the load balancer and must be in the same VPC and subnet as the compute resources managed in the current component deployment environment.
        • Components must be bound with different load balancers in different deployment environments to avoid route errors.
    2. Set Client Protocol.
      • HTTP has security risks. You are advised to select HTTPS.
      • If HTTPS is selected, click Use existing to select an existing certificate.

        If no certificate exists, click Create new to create a server certificate. For details, see Adding a Certificate.

    3. Set Domain Name.
      • If Automatically generated is selected, the automatically generated domain name is valid only for seven days.
      • If Bound is selected, enter a domain name.

  16. Set other component configurations.

  17. Click OK.
  18. Perform subsequent operations based on whether to release the release task by referring to the following table.

    Release or Not

    Operation

    Yes

    1. Click Complete and Execute. The system automatically checks whether the advanced settings of each component are correct.
    2. If an error is reported, perform the following operations and then continue:
      1. In the displayed dialog box, confirm the information and click OK.
      2. Click Advanced Settings in the Operation column of the abnormal component and set the parameter by referring to 16.
    3. If the advanced settings pass the pre-check, the components in the release task will be deployed in batches as configured.

      You can view the release records and release task information, and Cloning a Batch Deployment Release Task and Deleting a Release Task.

    No

    1. Click Finish. The system automatically checks whether the advanced settings of each component are correct.
    2. If an error is reported, perform the following operations and then continue:
      1. In the displayed dialog box, confirm the information and click OK.
      2. Click Advanced Settings in the Operation column of the abnormal component and set the parameter by referring to 16.
    3. If the advanced settings pass the pre-check, a release task in the To release state will be generated.

      On the Release Management page, you can view release task information, and Releasing a Release Task, Cloning a Batch Deployment Release Task, Editing a Batch Deployment Release Task, and Deleting a Release Task.