All Products
Search
Document Center

Microservices Engine:Add a service source

Last Updated:Aug 06, 2024

Cloud-native gateways support the following types of service sources: Container Service for Kubernetes (ACK) or ACK Serverless (ASK) clusters, Enterprise Distributed Application Service (EDAS) registries, Serverless App Engine (SAE) registries, Microservices Engine (MSE) ZooKeeper instances, and MSE Nacos instances. This topic describes how to add a service source in which your backend services are deployed or with which your backend services are registered. This way, the cloud-native gateway can dynamically obtain your backend service list.

Configuration

  • If a service source that is configured becomes invalid, manually delete the service source. Otherwise, stability issues may occur. For example, service information may fail to be synchronized from other sources in a timely manner.

  • You can add a DNS domain name or a fixed endpoint as a service source without the need to configure the service source. For more information, see Create a service.

  • If your cloud-native gateway does not allow you to monitor Ingress resources in Kubernetes clusters, you must upgrade your gateway version. For more information, see Upgrade an MSE cloud-native gateway.

  • If you add an ACK or ASK cluster as a service source of a cloud-native gateway, the cloud-native gateway monitors the services and endpoints of the ACK or ASK cluster to obtain the related information. If you configure HTTPS requests for a cloud-native gateway based on Ingress resources in Kubernetes clusters, the cloud-native gateway also needs to monitor cluster secrets to obtain information about HTTPS certificates.

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. On the Gateways page, click the name of the gateway.

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

  4. On the Source tab, click Add Source. In the Add Source panel, configure the parameters and click OK.

    You can set Source Type to Container Service, MSE Nacos, MSE ZooKeeper, SAE Built-in Registry, or EDAS Built-in Registry.

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

    Parameter

    Description

    ACK/ACK Serverless Cluster

    Select the cluster in which your backend service is deployed.

    Note

    When you create a gateway, you need to select the VPC in which the cluster is deployed. This way, when you add a service source, the cluster in this VPC is automatically obtained.

    Listen to Kubernetes Ingress

    • If you turn on the Listen to Kubernetes Ingress switch, the cloud-native gateway automatically monitors the changes of Ingress resources, and the monitored configurations of domain names and routes of the Ingress resources take effect.

    • If you turn off the Listen to Kubernetes Ingress switch, the cloud-native gateway no longer monitors the changes of Ingress resources, and the previously monitored configurations of domain names and routes of the Ingress resources become invalid. Exercise caution when you perform this operation.

    Important

    The priorities of the domain names and routes that are manually configured in the MSE console are higher than the priorities of the domain names and routes of the Ingress resources monitored by the cloud-native gateway.

    Ingress Class

    The Ingress class with which Ingress resources are associated.

    • If you do not specify this parameter, the cloud-native gateway monitors all the Ingress resources in the cluster.

    • If you specify an Ingress class for this parameter, the cloud-native gateway monitors the Ingress resources that have the class annotation or whose Spec.IngressClassName value is the same as the configured value. You cannot specify multiple Ingress classes for this parameter. For example, if you set this parameter to nginx, the cloud-native gateway monitors the Ingress resources whose IngressClass is nginx or the Ingress resources that are not associated with any Ingress class.

    Namespace

    The namespace to which Ingress resources belong.

    • If you do not specify this parameter, the cloud-native gateway monitors all the Ingress resources in all the namespaces of the cluster.

    • If you specify a single namespace for this parameter, the cloud-native gateway monitors the Ingress resources in the specified namespace of the cluster. You cannot specify multiple namespaces for this parameter at a time.

    Update Ingress Status

    If you set this parameter to Open, the IP address of the monitored Ingress is changed to the IP address of the Server Load Balancer (SLB) instance associated with the cloud-native gateway.

    Note

    You can use this feature only if the gateway version is 1.2.9 or later.

    Security Group Rules

    Security groups are configured in the node pool of the container cluster. In most cases, if an external component wants to access a service in the cluster, you must open all ports required by the service in the security groups.

    You can modify security groups. For more information, see Configure security group rules.

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

    Parameter

    Description

    Nacos Instance

    Select an instance.

    Note

    Only MSE Nacos instances whose MCPEnabled is set to true are displayed. You can change the parameter settings on the Parameter Settings page for the MSE Nacos instances.

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

    Parameter

    Description

    Cluster Name

    Select an instance.

    Parameters that need to be configured when you set Source Type to SAE Built-in Registry

    Parameter

    Description

    Namespace

    Select the namespace of the SAE registry where the service is deployed.

    Service Group

    If a special service group is specified for your service, click Add Service Group to add the service group.

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

    Parameter

    Description

    Microservices Space

    Select the microservice space of the EDAS registry where the service is deployed.

    Service Group

    If a special service group is specified for your service, click Add Service Group to add the service group.

Verify the result

Return to the Source tab on the Routes page and view the information about service sources. If the information about the service source that you added is displayed, the service source is added.