Updated on 2024-01-22 GMT+08:00

Rolling Release

After a component is created and deployed, you can upgrade a Running or Not ready component in rolling release mode.

In rolling release mode, only one or more instances are upgraded at a time and then added to the production environment. This process repeats until all old instances are upgraded. Services will not be interrupted during the upgrade.

For details about how to upgrade multiple components of the same application in batches, see Upgrading Components in Batches.

Prerequisites

You have created and deployed a component. For details, see Creating and Deploying a Component.

Procedure

  1. Log in to ServiceStage.
  2. Use either of the following methods to go to the component Overview page.

    • On the Application Management page, click the application to which the target component belongs, and click the component in Component List.
    • On the Component Management page, click the target component.

  3. Click Upgrade in the upper right corner of the page.
  4. Select Rolling Release for UpgradeType.
  5. Click Next and set the component version configuration information by referring to the following table. Parameters marked with an asterisk (*) are mandatory.

    Parameter

    Description

    Stack

    The value is fixed to the technology stack selected during component creation and deployment.

    *Software Package/Image

    The value is fixed to the component source selected during component creation and deployment.

    If you select Source code repository, create authorization by referring to Authorizing a Repository and set the code source.

    If you select a software package, the software package type supported by the component source is determined by the selected technology stack type. For details, see Table 1.

    *Upload Method

    If the component source is software package or image package, select an uploaded software package or image package. For details about the upload method, see Component Source.

    *Command

    This parameter is mandatory if the component source is source code, the component is deployed in the Kubernetes environment, and the selected technology stack type is Java, Tomcat, Node.js, Python, or PHP.

    • 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. For example:

        cd ./weather/

        mvn clean package

    *Dockerfile Address

    This parameter is mandatory if the component source is Source code repository, the component is deployed in the Kubernetes environment, and the selected technology stack type is Java, Tomcat, Node.js, Python, or PHP.

    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.

    *Component Version

    Version number of a component.

    • Automatically-generated: Click Generate. By default, the version number is the timestamp when you click Generate. 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.1214.172318, the version number is 2022.1214.17238.
    • 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.
      NOTICE:
      • The customized version number must be unique and cannot be the same as any historical version number of the component.

    Resources

    This parameter is available when the component is deployed in the Kubernetes environment.

    Components cannot be scheduled to nodes whose residual resources are fewer than the requested amount. For details about how to configure the request and limit parameters, see Managing Resources for Containers.

    You can customize CPU and Memory to set their quota, and change the maximum/minimum number of CPU cores and memory size (GiB) that can be used by components. To modify them, select the item to be changed and enter a new value.

    Unselected parameters indicate no restriction.

    JVM Parameters

    This parameter is available when the technology stack type is Java or Tomcat. It configures the memory size during Java code running.

    Enter the JVM parameter, for example, -Xms256m -Xmx1024m. Multiple parameters are separated by spaces.

    Tomcat

    This parameter is available when the technology stack type is Tomcat. It configures parameters such as the request path and port number of Tomcat.

    1. Select Tomcat. The Tomcat dialog box is displayed.
    1. Click Use Sample Code and edit the template file based on service requirements.
    2. Click OK.

    Advanced Settings

    This parameter is available when the component is deployed in the Kubernetes environment.

    Set Component Configuration, Deployment Configuration, and O&M Monitoring by referring to 10.

    *Deployment Batches

    This parameter is available when the component is deployed in the Kubernetes environment.

    Number of batches in which component instances are upgraded. The value range is [1, Total number of instances]. Total number of instances refers to the number of running instances of the component.

    For example, if there are 4 component instances and Deployment Batches is set to 2, these component instances are upgraded in two batches, and each batch involves two component instances.

  6. Click Upgrade.

    Wait until the component status changes from Upgrading/Rolling back to Running, indicating that the component version configuration is successfully upgraded.

Follow-Up Operations

Operation

Description

Redeploy a component

You can select a historical version configuration from the deployment record list and use the version configuration as a template to redeploy components. For details, see Redeploying a Component.