Help Center/ ServiceStage/ User Guide/ Component Management/ Upgrading a Single Component/ Upgrading a Component in Single-batch Release Mode
Updated on 2024-11-22 GMT+08:00

Upgrading a Component in Single-batch Release Mode

After a component is created and deployed, you can upgrade a component in single-batch release mode. In single-batch release mode, all instances are upgraded at a time. During the upgrade, component services will be interrupted. This is applicable to the test upgrade scenario or the upgrade scenario where services are to be stopped. The upgrade takes a short time.

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

Prerequisites

Upgrading a Component in Single-batch Release Mode

  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 component belongs, and click the target 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 Single-batch Release.
  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.

    *YAML Mode

    Uses YAML configurations to upgrade components.

    • Disabled: The UI configurations are used to upgrade components.
    • Enabled: The YAML configurations are used to upgrade components. The latest load information of the component is automatically synchronized from CCE where the target component is deployed for component upgrade after modification. Alternatively, click Import YAML File to import the edited YAML configuration file of the target component.
    NOTE:

    If YAML configurations are used to upgrade components, the parameters in the YAML configuration file are described in Deployment.

    *Software Package/Image

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

    • YAML Mode disabled: If you select Source code repository, create authorization by referring to Creating Repository Authorization and set the code source. If you select a software package or image package, the option is fixed to the software package type (JAR, WAR, or ZIP) or image package type selected during component creation and deployment. It is determined by the selected technology stack type. For details, see Table 1.
    • YAML Mode enabled: If you select Source code repository, create authorization by referring to Creating Repository Authorization and set the code source. If you select a software package, the option is fixed to the software package type (JAR, WAR, or ZIP) selected during component creation and deployment. It is determined by the selected technology stack type. For details, see Table 1.

    *Upload Method

    • YAML Mode disabled: 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.
      NOTE:

      If you select an image package:

      • 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.
    • YAML Mode enabled: If the component source is software package, select an uploaded software package. For details about the upload method, see Component Source.

    *Command

    This parameter is mandatory when YAML Mode is disabled, 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.

    • 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

    This parameter is mandatory when YAML Mode is disabled, 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

    Component version number, which can be automatically generated or customized.

    • 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.0803.104321, the version number is 2022.0803.10431.
    • Customized: Enter a value 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. Otherwise, the current deployment record will overwrite the historical deployment record of the same version.

    *Container Name

    If the component is deployed in a container and the technology stack is not Docker, you can customize the container name.

    The name contains 1 to 63 characters starting with a lowercase letter and ending with a lowercase letter or digit. Only lowercase letters, digits, and hyphens (-) are allowed.

    Resources

    This parameter is available when YAML Mode is disabled.

    You can customize CPU and Memory to set their quota, and set the maximum/minimum number of CPU cores and memory size (GiB) that can be used by components. In this way, you can set the number of resources required by each component instance.

    When resource Request is specified for a component instance, CCE uses this information to determine the node to which the component instance is scheduled. When resource Limit is specified for a component instance, CCE ensures that the resources occupied by the running component instance do not exceed the limit. CCE will also reserve the requested number of system resources for the component instance. For details about how to configure them, see Resource Management.

    To modify them, select the item to be changed and enter a new value. Unselected parameters indicate no restriction.

    NOTE:

    If the source of the component selected for Upload Method is image package and multi-container deployment is enabled, set this parameter for each container instance as required.

    JVM Parameters

    This parameter is available when YAML Mode is disabled and 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. If the parameter is left blank, the value is empty.

    Tomcat

    This parameter is available when YAML Mode is disabled and 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.
    2. Click Use Sample Code and edit the template file based on service requirements.
      NOTE:

      In Tomcat configuration, the default server.xml configuration is used. The context path is /, and no application path is specified.

      If you need to customize an application path, customize the Tomcat context path by referring to How Do I Customize a Tomcat Context Path?

    3. Click OK.

    Cloud Service Settings

    If the component is deployed based on a container and YAML Mode is disabled, set this parameter as required by referring to Managing Cloud Service Settings of a Container-Deployed Component.

    NOTICE:

    Components bound to RDS cannot be deleted. Otherwise, the upgrade will fail.

    Container Settings

    If the component is deployed based on a container and YAML Mode is disabled, set this parameter as required by referring to Managing Container Settings of a Container-Deployed Component.

    Advanced Settings

    If YAML Mode is disabled, set this parameter as required by referring to Managing Advanced Settings of a Container-Deployed Component.

    *Graceful Time Window

    You can set a graceful scale-in time window to save important data before a component instance stops. The value ranges from 0 to 9999, in seconds. The default value is 30.

    For example, if an application has two instances and only one instance will be kept after the scale-in operation, you can still perform certain operations on the instance to be stopped in the specified time window.

  6. Click Upgrade.

    Wait until the component status changes from Upgrading/Rolling back the component to Running, indicating that the component has been 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.