All Products
Search
Document Center

Microservices Engine:Add a service

Last Updated:Aug 06, 2024

To allow a gateway to obtain service endpoints, you must add an existing service to the gateway and register the service as a destination service for routing. Microservices Engine (MSE) cloud-native gateways allow you to add services from the following sources: Container Service for Kubernetes (ACK) clusters, MSE Nacos instances, MSE Zookeeper instances, Enterprise Distributed Application Service (EDAS), Serverless App Engine (SAE), fixed endpoints, Domain Name System (DNS) domain names, and Function Compute.

Procedure

  1. Log on to the MSE console. In the top navigation bar, select a region.

  2. In the left-side navigation pane, choose Cloud-native Gateway > Gateways.

  3. On the Gateways page, click the name of the gateway.

  4. In the left-side navigation pane, click Routes. On the page that appears, click the Services tab.

  5. On the Services tab, click Add Service. In the Add Service panel, configure the parameters and click OK.

    Note
    • Add a service from an ACK cluster: If you select Container Service from the Service Source drop-down list, the cloud-native gateway obtains the service list from an ACK cluster or ACK Serverless cluster and allows you to add the services in the list and their backend node endpoints to the gateway.

    • Add a service from a fixed endpoint: If the service discovery mechanism is not provided for the service that you want to add, you must manually add the backend node endpoints of the service to the gateway.

    • Add a service from a DNS domain name: If you select DNS Domain Name from the Service Source drop-down list, the cloud-native gateway allows you to use the resolution result of the DNS as the backend service endpoint.

    Parameters that need to be configured when you set Service Source to Container Service

    Parameter

    Description

    Namespace

    Select a namespace to which the cluster belongs.

    By default, services in the arms-prom, kube-system, and mse-pilot namespaces are not displayed.

    Services

    Select one or more services in the Services section.

    Parameters that need to be configured when you set Service Source to MSE Nacos

    Parameter

    Description

    Namespace

    Select a namespace to which the MSE Nacos instance belongs.

    Services

    Select one or more services in the Services section.

    By default, services whose names start with consumer are not displayed.

    Parameters that need to be configured when you set Service Source to MSE ZooKeeper

    Parameter

    Description

    Services

    Select one or more services in the Services section.

    Parameters that need to be configured when you set Service Source to EDAS Built-in Registry

    Parameter

    Description

    Namespace

    Select the microservices namespace to which the service belongs.

    Services

    Select one or more services in the Services section.

    Parameters that need to be configured when you set Service Source to SAE Registry

    Parameter

    Description

    Namespace

    Select the namespace to which the service belongs.

    Services

    Select one or more services in the Services section.

    Parameters that need to be configured when you set Service Source to Function Compute

    Parameter

    Description

    Service Name

    Select the name of the service to which the function belongs.

    Version or Alias

    Select the version or alias of the service to which the function belongs.

    Functions

    Select one or more functions.

    Parameters that need to be configured when you set Service Source to Fixed Address

    Parameter

    Description

    Service Name

    Enter a name of the service.

    Service Address

    The service endpoint varies with service sources. The endpoint must be in the format of <IP address>:<Service port>. Separate endpoints with line feeds.

    TLS Mode

    Select a TLS mode from the drop-down list. Default value: Disabled. Valid values:

    • Disabled: TLS is disabled for service access.

    • TLS: One-way TLS is enabled for HTTPS-based service access.

    • mTLS: mTLS is enabled for mutual authentication.

    Parameters that need to be configured when you set Service Source to DNS Domain Name

    Parameter

    Description

    Service Name

    Enter a name of the service.

    Service Port

    Enter a port on which the domain name provides services. Valid values: 1 to 65535.

    Domain Names

    Enter one or more domain names, such as www.aliyun.com. Separate multiple domain names with line feeds.

    TLS Mode

    Select a TLS mode from the drop-down list. Default value: Disabled. Valid values:

    • Disabled: TLS is disabled for service access.

    • TLS: One-way TLS is enabled for HTTPS-based service access.

    • mTLS: mTLS is enabled for mutual authentication.

Note

When the cloud-native gateway forwards a request to a backend service that uses a specified domain name, the gateway does not rewrite the host domain name as the specified domain name. For more information about how to rewrite a hostname, see Configure a rewrite policy.

Verify the result

Return to the Services tab on the Routes page, and view the information about the service that you added. If the information about the service that you added, such as Service Name, Service Address, and Service Source, is displayed, the service is added.

References

After a service is added, you can manage the service. For more information, see Manage services.