Updated on 2023-06-25 GMT+08:00

Deploying a Component

This section describes how to deploy static components in the corresponding environment.

When creating an application component, you can also select Create and Deploy. The deployment procedure is the same as that described in this section.

Prerequisites

  1. An application component has been created or is being created, and has been configured. For details, see Creating an Application Component.
  2. The environment has been created. For details, see Environment Management.
  3. If you deploy components based on software packages or image packages, you need to upload the software packages or image packages.
    • Upload the software package to the OBS bucket. For details, see Uploading a File.
    • Upload the image package to the image repository. For details, see Uploading an Image.

Procedure

  1. Log in to ServiceStage and choose Application Management > Application List.
  2. Click an application. The Overview page is displayed.
  3. On the Component List tab, select a component and click Deploy in the Operation column.
  4. Set basic parameters. Parameters marked with an asterisk (*) are mandatory.

    Parameter

    Description

    *Environment

    Select an environment.

    *Version

    Component version number, for example, 1.0.0.

    Description

    Description of the component.

    *Deployment System

    Supports Cloud Container Engine and VM.

    For details, see Deployment Mode.

    *Resource Type

    This parameter takes effect only when VM is selected for Deployment System.

    You can select Elastic cloud server.

    *Basic Resource

    The basic resources contained in the selected environment are automatically loaded. Select the resources as required.

    *Instances

    Number of instances in an application component. An application component can have one or more instances. You can specify the number of instances as required.

    Configuring multiple instances for an application component ensures high reliability of the application component. For such a component, if an instance is faulty, the component can still run properly.

    NOTE:
    • This parameter is invalid when VM is selected for Deployment System.
    • The number of component instances is determined by the number of Basic Resources.
    • When the quota for the number of microservice instances specified by the engine specifications is about to be used up, the engine allows component deployment operations that exceed the remaining quota to succeed at the same time to ensure availability. Expand the capacity of the engine as soon as possible to prevent component deployment failures.

    *Resource Quota

    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 as required.

    NOTE:
    • This parameter is not displayed when the component type is Common and the runtime system is Docker.
    • This parameter is invalid when VM is selected for Deployment System.

    Component Status

    Sets the component status as required.

    NOTE:

    This parameter is available when the component type is Common, the runtime system is Docker, and Cloud Container Engine is selected for Deployment System.

  5. Click Next to configure the component.

    • When the component type is Common and the runtime system is Docker, perform the following operations:
      1. Select an image. Multiple containers are supported. You can click Add Container to add an image.
      2. Select an image version.
      3. Enter a container name.
      4. (Optional) Set Resource Quota. 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 as required.
      5. (Optional) Set Advanced Settings.
      6. (Optional) Enable Public Network Access.
        1. Set Public Network Load Balancer.

          Select an existing ELB resource in the environment.

          If no ELB resource exists, click Add One. On the Edit Environment page that is displayed, click Add Optional Resource to add created ELB resources to the environment.

          For details about how to create an ELB resource, see Creating a Load Balancer.

        2. (Optional) Set HTTPS.

          If HTTPS is enabled, click Use existing to select an existing certificate.

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

        3. Set Domain Name.

          Enter a customize domain name. For details, see Configuring Domain Name Mappings.

        4. Set Listening Port.

          Set the listening port of the application process.

      7. (Optional) Set Database.

        Select Distributed session. For details, see Configuring Distributed Sessions.

      8. (Optional) Set Local Time.

        Change the time zone of the container node. By default, the time zone is the same as that of the region where the container node is located.

      9. (Optional) Set Scheduling Policies. For details, see Configuring a Scheduling Policy of an Application Component Instance.
      10. (Optional) Set Upgrade Policies. For details, see Configuring an Upgrade Policy of an Application Component Instance.
    • For other types of components for which Cloud Container Engine is selected for Deployment System in 4, perform the following operations:
      1. Set Image.
        • If the application source is a software package, source code, or template, the configured static component information will be loaded.
        • If Runtime System is set to Docker, select an image package from the SWR image repository.
      2. (Optional) Enable Public Network Access.
        1. Set Public Network Load Balancer.

          Select an existing ELB resource in the environment.

          If no ELB resource exists, click Add One. On the Edit Environment page that is displayed, click Add Optional Resource to add created ELB resources to the environment.

          For details about how to create an ELB resource, see Creating a Load Balancer.

        2. (Optional) Set HTTPS.

          If HTTPS is enabled, click Use existing to select an existing certificate.

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

        3. Set Domain Name.

          Enter a customize domain name. For details, see Configuring Domain Name Mappings.

        4. (Optional) Set Listening Port.

          Listening port of an application process. If Tomcat8 is selected as the Runtime System, this port is set to 8080 by default. You can customize this port.

      3. Set Cloud Service Engine.

        This parameter is mandatory for microservice components.

        By default, the microservice engine added in the environment is selected. For details about how to create a microservice engine, see Creating an Exclusive Microservice Engine.

      4. (Optional) Set JVM.

        This parameter is mandatory when Runtime System is set to Java8 or Tomcat8.

        Enter the JVM parameter, for example, -Xms256m -Xmx1024m. Multiple parameters are separated by spaces. If the parameter is left blank, the default value is used.

      5. (Optional) Configure Tomcat parameters.

        This parameter is mandatory when Runtime System is set to Tomcat8.

        1. Select Parameter settings. The Tomcat dialog box is displayed.
        2. Click Use Sample Code and edit the template file based on service requirements.
        3. Click OK.
      6. (Optional) Set Database.

        Select Distributed session. For details, see Configuring Distributed Sessions.

      7. (Optional) Set Local Time.

        Change the time zone of the container. By default, the time zone is the same as that of the region where the container node is located.

      8. (Optional) Set Advanced Settings.
    • For other types of components for which VM is selected for Deployment System in 4, perform the following operations:
      1. (Optional) Enable Public Network Access.
        1. Set Public Network Load Balancer.

          Select the created load balancer.

          If no load balancer exists, create one. For details, see Creating a Load Balancer.

        2. (Optional) Set HTTPS.

          If HTTPS is enabled, click Use existing to select an existing certificate.

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

        3. Set Domain Name.

          Enter a customize domain name. For details, see Configuring Domain Name Mappings.

      2. (Optional) Set Cloud Service Engine.

        This parameter is mandatory for microservice components.

        By default, the microservice engine added in the environment is selected. For details about how to create a microservice engine, see Creating an Exclusive Microservice Engine.

      3. (Optional) Set Environment Variables.

        For details, see Configuring Environment Variables of a Component.

      4. (Optional) Set JVM.

        This parameter is mandatory when Runtime System is set to Java8 or Tomcat8.

        Enter the JVM parameter, for example, -Xms256m -Xmx1024m. Multiple parameters are separated by spaces. If the parameter is left blank, the default value is used.

      5. (Optional) Configure Tomcat parameters.

        This parameter is mandatory when Runtime System is set to Tomcat8.

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

  6. Click Next, confirm the specifications, and click Deploy.

    After the component is deployed, you can view the component status in the Environment View on the Overview page.