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 API operations. 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. This topic describes how to add a service to a cloud-native gateway.
Procedure
Log on to the MSE console. In the top navigation bar, select a region.
In the left-side navigation pane, choose Cloud-native Gateway > Gateways.
On the Gateways page, find your gateway and click Route Settings in the Actions column. In the upper-right corner of the page that appears, click Previous Version.
In the left-side navigation pane, choose Service Management > Services.
On the Services page, click Add Service.
In the Add Service panel, configure the parameters and click OK.
NoteAdd 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.
If you select Container Service from the Service Source drop-down list, you must configure the following parameters.
Parameter
Description
Namespace
Select a namespace to which the MSE Nacos instance 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.
If you select MSE Nacos from the Service Source drop-down list, you must configure the following parameters.
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.
If you select MSE ZooKeeper from the Service Source drop-down list, you must configure the following parameter.
Parameter
Description
Services
Select one or more services in the Services section.
If you select EDAS Built-in Registry from the Service Source drop-down list, you must configure the following parameters.
Parameter
Description
Microservice Space
Select the microservices namespace to which the service belongs.
Services
Select one or more services in the Services section.
If you select SAE Registry from the Service Source drop-down list, you must configure the following parameters.
Parameter
Description
Namespace
Select the microservices namespace to which the service belongs.
Services
Select one or more services in the Services section.
If you select Function Compute from the Service Source drop-down list, you must configure the following parameters.
Parameter
Description
Service Name
Select the name of the service 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.
If you select Fixed Address from the Service Source drop-down list, you must configure the following parameters.
Parameter
Description
Service Name
Enter a name of the service.
Service Address
The backend node endpoint of the service. The endpoint varies with service sources. The endpoint must be in the format of
<IP address of the backend node>:<Service port number>
. Separate endpoints with line feeds.TLS Mode
Select a Transport Layer Security (TLS) mode from the drop-down list. Default value: Disabled. Valid values:
Disabled: Keep Disabled for service access.
TLS: Select TLS for HTTPS-based service access.
mTLS: Select mTLS for mutual authentication.
If you select DNS Domain Name from the Service Source drop-down list, you must configure the following parameters.
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: Keep Disabled for service access.
TLS: Select TLS for HTTPS-based service access.
mTLS: Select mTLS for mutual authentication.
NoteWhen the cloud-native gateway forwards a request to a backend service that uses a specified domain name, the gateway does not rewrite the hostname 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 page to view the service information. If the information about the service, such as Service Name, Service Address, and Service Source, is displayed, the service is added.