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

Maintaining Microservices

You can use service catalogs to view microservice details and search for target microservices to maintain microservices.

The following information is displayed on the Service Catalog page:

  • Application List: displays all applications of the current user. You can search for the target application by application name, or filter applications by environment.
  • Microservice List: displays all microservices of the current user. You can search for the target microservice by microservice name, or filter microservices by environment and application.
  • Instance List: displays all instances of the current user. You can search for the target instance by microservice name, or filter instances by environment or application.

Dynamic Configuration

  1. Log in to ServiceStage and choose Infrastructure > Cloud Service Engines.
  2. Click Console of a microservice engine.
  3. Choose Service Catalog.
  4. Click a microservice.
  5. Choose Dynamic Configuration. The Dynamic Configuration page is displayed. On the Dynamic Configuration tab, perform the following operations.

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

    Operation

    Procedure

    Export configurations.

    Select a scope from the All drop-down list and click Export to export the JSON configuration file of the current scope.

    The scope format is as follows:
    • Microservice name@Application to which the microservice belongs
    • Microservice name@Application to which the microservice belongs#Version number

    Import configurations.

    1. Click Import and select a scope.
      The scope format is as follows:
      • Microservice name@Application to which the microservice belongs
      • Microservice name@Application to which the microservice belongs#Version number
    2. Click ··· to select a configuration item file.
    3. Click Upload to import configuration items in batches.
    4. Click Close.

    Create configurations.

    1. Click Create Configuration and select a scope.
    2. Enter Configuration Item.
    3. Enter Value.
    4. Click OK to save the settings.

    Modify configurations.

    1. Click Edit in the Operation column corresponding to the target configuration item.
    2. Enter a new value in the Value text box.
    3. Click OK to save the settings.

    Delete configurations.

    1. Click Delete in the Operation column corresponding to the target configuration item.
    2. Click OK to delete the configuration.

Dark Launch

  1. Log in to ServiceStage and choose Infrastructure > Cloud Service Engines.
  2. Click Console of a microservice engine.
  3. Choose Service Catalog.
  4. Click a microservice. On the displayed page, click Dark Launch.
  5. Click Add Launch Rule.

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

        Configuration Item

        Description

        Rule Name

        Name of a customized rule.

        Scope

        • Version of the microservice to which the rule applies.
        • Add custom version: adds 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 customize a launch rule:
      1. Click Customize.
      2. Set the following parameters.

        Configuration Item

        Description

        Rule Name

        Name of a customized rule.

        Scope

        • Version of the microservice to which the rule applies.
        • Add custom version: adds a new version as prompted.

        Rule Configuration

        • Parameter Name

          This name is 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 (?) can be used for fuzzy matching when you specify the value of Rules. The asterisk (*) represents an unlimited number of characters, and the question mark (?) represents only one character. 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 (?) cannot be used for fuzzy matching.
      3. Click OK to complete the customized rule configuration and dark launch.

Delete a microservice.

  1. Log in to ServiceStage and choose Infrastructure > Cloud Service Engines.
  2. Click Console of a microservice engine.
  3. Choose Service Catalog.
  4. Select the microservice to be deleted, click Delete, and delete the microservice as prompted.

    • If the number of microservice instances is 0, you can directly delete the microservice.
    • If the number of microservice instances is not 0, the microservice will be re-registered with the service center after being deleted for a period of time.

Viewing Microservice Details

  1. Log in to ServiceStage and choose Infrastructure > Cloud Service Engines.
  2. Click Console of a microservice engine.
  3. Choose Service Catalog.
  4. Click a microservice. The microservice details page is displayed.

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

Viewing a Service Contract

  1. Log in to ServiceStage and choose Infrastructure > Cloud Service Engines.
  2. Click Console of a microservice engine.
  3. Choose Service Catalog.
  4. Click a microservice. The microservice details page is displayed.
  5. Click Service Contract to view the service contract.

Adding a Label

  1. Log in to ServiceStage and choose Infrastructure > Cloud Service Engines.
  2. Click Console of a microservice engine.
  3. Choose Service Catalog.
  4. Click a microservice. On the displayed page, click Manage Tag next to Label.
  5. Click Add Label, and enter Key and Value.
  6. Click OK to save the settings.

Modifying Microservice 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.

Test

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

  1. Log in to ServiceStage and choose Infrastructure > Cloud Service Engines.
  2. Click Console of a microservice engine.
  3. Go to the microservice console.
  4. Choose Service Catalog > Instance List.
  5. Select the target instance and change the microservice instance status.

    • Offline

      In the Operation column, click Offline.

    • Online

      In the Operation column, click Online.

    • Out of Service

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

    • Test

      In the Operation column, choose More > Test.