Updated on 2024-08-05 GMT+08:00

Managing Microservices

You can use the microservice catalog to view microservice details and search for target microservices to maintain microservices. The Microservice Catalog page contains the following tabs:

  • Application List: displays all applications of the current microservice engine. You can search for the target application by application name, or filter applications by environment. For details, see Viewing the Application List.
  • Microservice List: For details about the operations supported by in Microservice List, see the following table.

    Operation

    Description

    Viewing the Microservice List

    Displays all microservices of the current microservice engine. You can search for the target microservice by microservice name, or filter microservices by environment and application.

    Viewing Microservice Details

    On the microservice details page, you can view the instance list, called services, calling services, dynamic configuration, and service contract.

    Creating a Microservice

    Creates a microservice.

    Cleaning Versions Without Instances

    Cleans microservice versions that have no instances.

    Deleting a Microservice

    Deletes a microservice that is no longer used.

    Dynamic Configuration

    Creates a microservice-level configuration.

    Dark Launch

    In dark launch, new features are tested in a selected group of users. When the features become mature and stable, they are released to all users.

  • Instance List: For details about the operations supported by in Instance List, see the following table.

    Operation

    Description

    Viewing the Instance List

    Displays all instances of the current microservice engine. You can search for the target instance by microservice name, or filter instances by environment and application.

    Changing the Instance Status

    Status indicates the status of a microservice instance.

Viewing the Application List

  1. Log in to ServiceStage and choose Cloud Service Engine > Engines.
  2. Select the target microservice engine from the Microservice Engine drop-down list in the upper part of the page.

  3. Choose Microservice Catalog.

    • For microservice engines with security authentication disabled, go to 5.
    • For microservice engines with security authentication enabled, go to 4.

  4. In the displayed Security Authentication dialog box, enter the account name and password, and click OK.

  5. Click Application List to view details about all applications of the current account under the engine.

    You can search for the target application by application name, or filter applications by environment.

Viewing the Microservice List

  1. Log in to ServiceStage and choose Cloud Service Engine > Engines.
  2. Select the target microservice engine from the Microservice Engine drop-down list in the upper part of the page.

  3. Choose Microservice Catalog.

    • For microservice engines with security authentication disabled, go to 5.
    • For microservice engines with security authentication enabled, go to 4.

  4. In the displayed Security Authentication dialog box, enter the account name and password, and click OK.

  5. Click Microservice List to view all microservices of the current account under the engine.

    You can search for the target microservice by microservice name, or filter microservices by environment and application.

Viewing Microservice Details

  1. Log in to ServiceStage and choose Cloud Service Engine > Engines.
  2. Select the target microservice engine from the Microservice Engine drop-down list in the upper part of the page.

  3. Choose Microservice Catalog.

    • For microservice engines with security authentication disabled, go to 5.
    • For microservice engines with security authentication enabled, go to 4.

  4. In the displayed Security Authentication dialog box, enter the account name and password, and click OK.

  5. Click the microservice to be viewed in Microservice List. On the displayed page, view the instance list, called services, calling services, configurations, and service contract.

Creating a Microservice

  1. Log in to ServiceStage and choose Cloud Service Engine > Engines.
  2. Select the target microservice engine from the Microservice Engine drop-down list in the upper part of the page.

  3. Choose Microservice Catalog.

    • For microservice engines with security authentication disabled, go to 5.
    • For microservice engines with security authentication enabled, go to 4.

  4. In the displayed Security Authentication dialog box, enter the account name and password, and click OK.

  1. Choose Microservice List > Create a Microservice and set microservice parameters by referring to the following table. Parameters marked with an asterisk (*) are mandatory.

    Parameter

    Description

    *Microservice

    Microservice name, for example, myServiceName.

    *Application

    Name of the application to which the microservice belongs. Microservices are isolated by applications.

    *Version

    Microservice version. The default value is 1.0.0.

    NOTE:

    The microservice version is in the format of X.Y.Z or X.Y.Z.B, where X, Y, Z, and B are digits and range from 0 to 32767. The value contains 3 to 46 characters.

    *Environment

    Environment where the microservice is located to isolate microservice data, including the version and instance.

    Detail

    Microservice description.

  2. Click OK.

    Once the microservice is created, it will be displayed in Microservice List.

Cleaning Versions Without Instances

  1. Log in to ServiceStage and choose Cloud Service Engine > Engines.
  2. Select the target microservice engine from the Microservice Engine drop-down list in the upper part of the page.

  3. Choose Microservice Catalog.

    • For microservice engines with security authentication disabled, go to 5.
    • For microservice engines with security authentication enabled, go to 4.

  4. In the displayed Security Authentication dialog box, enter the account name and password, and click OK.

  5. Choose Microservice List > Clean No Instance Services. Select the microservice version without instances to be cleaned.

    You can search for the target microservice by microservice name, or filter microservices by environment and application.

  6. Click OK.

Deleting a Microservice

  • After a microservice is deleted, you can restore it by referring to Restoring Backup Data.
  • If the service to be deleted has instances, delete the instances first. Otherwise, the service will be registered again.
  1. Log in to ServiceStage and choose Cloud Service Engine > Engines.
  2. Select the target microservice engine from the Microservice Engine drop-down list in the upper part of the page.

  3. Choose Microservice Catalog.

    • For microservice engines with security authentication disabled, go to 5.
    • For microservice engines with security authentication enabled, go to 4.

  4. In the displayed Security Authentication dialog box, enter the account name and password, and click OK.

  5. Click Microservice List.

    • To delete microservices in batches, select the microservices to be deleted and click Delete above the microservices.
    • To delete one microservice, locate the row that contains the microservice to be deleted and click Delete in the Operation column.

  6. In the displayed dialog box, enter DELETE to confirm the deletion and click OK.

Dynamic Configuration

  1. Log in to ServiceStage and choose Cloud Service Engine > Engines.
  2. Select the target microservice engine from the Microservice Engine drop-down list in the upper part of the page.

  3. Choose Microservice Catalog.

    • For microservice engines with security authentication disabled, go to 5.
    • For microservice engines with security authentication enabled, go to 4.

  4. In the displayed Security Authentication dialog box, enter the account name and password, and click OK.

  5. Click Microservice List.
  6. Click the target microservice.
  7. Choose Dynamic Configuration. On the Dynamic Configuration tab, perform the following operations.

    Configuration items are stored in plaintext. Do not include sensitive data.

    Operation

    Procedure

    Creating a configuration item

    See Creating a Microservice-Level Configuration. Microservice-level is selected for Configuration Range and Microservices is set to the current microservice.

    Viewing historical versions

    Click View Historical Version in the Operation column of the target configuration item.

    Disabling a configuration item

    1. Click Disable in the Operation column of the target configuration item.
    2. Click OK.

    Modifying a configuration item

    1. Click More > Edit in the Operation column of the target configuration item.
    2. On the configuration details page, click Edit.
    3. On the Configuration Details tab, enter the new configuration.
    4. Click Save.

    Deleting a configuration item

    1. Click More > Delete in the Operation column of the target configuration item.
    2. Click OK.

Dark Launch

In dark launch, new features are tested in a selected group of users. When the features become mature and stable, they are released to all users. This ensures the smooth feature rollout.

  1. Log in to ServiceStage and choose Cloud Service Engine > Engines.
  2. Choose Microservice Catalog.

    • For microservice engines with security authentication disabled, go to 4.
    • For microservice engines with security authentication enabled, go to 3.

  3. In the displayed Security Authentication dialog box, enter the account name and password, and click OK.

  4. In the microservice list, click a microservice. On the displayed page, choose Dark Launch.
  5. Click Add a Launch Rule.

    • To add a launch rule by Weight:
      1. Click Weight.
        Figure 1 Adding a launch rule by weight
      2. Set the following parameters.

        Item

        Description

        Rule Name

        Name of the rule.

        Scope

        • Microservice version to which the rule applies.
        • Select Do you want to add a customized version? and add a new version as prompted.

        Rule Configuration

        Traffic allocation rate for the selected version. Traffic is evenly allocated to the selected service versions based on the configured value.

      3. Click OK to complete the weight rule configuration and dark launch.
    • To add a launch rule by Customization:
      1. Click Customization.
        Figure 2 Customizing a launch rule
      2. Set the following parameters.

        Item

        Description

        Rule Name

        Name of the rule.

        Scope

        • Microservice version to which the rule applies.
        • Select Do you want to add a customized version? and add a new version as prompted.

        Rule Configuration

        • Parameter Name

          Name customized according to the key field provided by the service contract.

          This key must exist in the contract. It is possible that the server API is String paramA, but paramB is actually generated after the annotation is added. Therefore, paramB should be set here.

        • Rules
          Value corresponding to the key of a contract.
          NOTE:
          • If ~ is selected from the drop-down list next to Rules, the asterisk (*) and question mark (?) in the Rules value can be used for fuzzy matching. The asterisk (*) indicates that the character length is not limited, and the question mark (?) indicates that only one character is allowed. For example, if the rule value of Name is set to *1000, all Name fields ending with 1000 can be matched.
          • If ~ is not selected from the drop-down list next to Rules, the asterisk (*) and question mark (?) in the Rules value cannot be used for fuzzy matching.
      3. Click OK to complete the customization rule configuration and dark launch.

Viewing the Instance List

  1. Log in to ServiceStage and choose Cloud Service Engine > Engines.
  2. Select the target microservice engine from the Microservice Engine drop-down list in the upper part of the page.

  3. Choose Microservice Catalog.

    • For microservice engines with security authentication disabled, go to 5.
    • For microservice engines with security authentication enabled, go to 4.

  4. In the displayed Security Authentication dialog box, enter the account name and password, and click OK.

  5. Click Instance List to view all instances of the engine.

    You can search for the target instance by microservice name, or filter instances by environment and application.

Changing the Instance Status

Status indicates the status of a microservice instance. The following table describes the microservice instance statuses.

Status

Description

Online

The instance is running and can provide services.

Offline

Before the instance process ends, the instance is marked as not providing services externally.

Out of Service

The instance has been registered with the microservice engine and does not provide services.

Testing

The instance is in the internal joint commissioning state and does not provide services.

  1. Log in to ServiceStage and choose Cloud Service Engine > Engines.
  2. Select the target microservice engine from the Microservice Engine drop-down list in the upper part of the page.

  3. Choose Microservice Catalog.

    • For microservice engines with security authentication disabled, go to 5.
    • For microservice engines with security authentication enabled, go to 4.

  4. In the displayed Security Authentication dialog box, enter the account name and password, and click OK.

  5. Click Instance List, select the target instance, and change the instance status.

    • Offline

      In the Operation column, click Offline.

    • Online

      In the Operation column, choose More > Online.

    • Out of Service

      In the Operation column, choose More > Out of Service.

    • Testing

      In the Operation column, choose More > Testing.