All Products
Search
Document Center

Alibaba Cloud Service Mesh:Connect ASM to Consul service registries

Last Updated:Mar 11, 2026

When you migrate microservices to Alibaba Cloud Service Mesh (ASM), services already registered in Consul must remain discoverable by services inside the mesh. ASM provides a syncer component (ASM-se-syncer) that watches your Consul service registries and automatically creates Istio service entries for each Consul service. This lets mesh-based services discover and call Consul-registered services without manual configuration.

How it works

ASM-se-syncer connects to one or more Consul registries and performs one-directional synchronization:

DirectionBehaviorAction required
Consul to ASMAutomatic. When a service is registered, updated, or deleted in Consul, the corresponding service entry in ASM is created, updated, or deleted.None after initial setup.
ASM to ConsulNot automatic. Services running inside ASM are not registered in Consul.Manually register ASM services in Consul if Consul-based consumers need to call them.

When you install ASM-se-syncer via Helm, it creates a Deployment named asm-serviceregistry-syncer in your ACK cluster. This Deployment continuously watches the specified Consul registries for changes.

Each synchronized service appears as a service entry in the namespace you specify. Service entries are named using the format <prefix><consul-service-name>. For example, if the prefix is consul- and the Consul service name is web, the resulting entry is named consul-web.

Before you begin

Before you begin, make sure that you have:

  • An ASM instance running version v1.7.5.31-g28ec7490-aliyun or later

  • One or more Consul service registries deployed. For details, see Installing Consul on Kubernetes.

  • An ACK cluster added to your ASM instance, with pods that can reach the Consul server (for example, the Consul server runs in the same cluster, exposes a public endpoint, or provides an accessible internal endpoint)

  • Sample services (such as Web and Web2) and a built-in Consul service registered in the Consul registries. For details, see Services.

  • An AccessKey pair for your account. For details, see Create an AccessKey pair.

Install ASM-se-syncer

The following steps cover gathering the required configuration values and installing the syncer with Helm.

Gather configuration values

Collect the following values. You will add them to the Helm chart configuration file (values.yaml).

ValueWhere to find it
ASM instance IDASM console > Service Mesh > Mesh Management > Name/ID column
Cluster region IDACK console > Clusters > click the cluster name > Cluster Information > Region column. For example, if the region is China (Beijing), the region ID is cn-beijing. See Supported regions.
AccessKey ID and AccessKey secretSee Create an AccessKey pair.

Configure and install the syncer

  1. Connect to the ACK cluster with kubectl. For details, see Obtain the kubeconfig file of a cluster and use kubectl to connect to the cluster.

  2. Install Helm on your computer.

    Note

    After you connect to the ACK cluster with kubectl, the Helm client automatically uses the same kubeconfig file.

  3. Download and decompress the asm-se-syncer Helm chart.

  4. Open values.yaml in the asm-se-syncer folder. Add the ASM instance ID, cluster region ID, AccessKey ID, and AccessKey secret. Then configure the Consul registry connection. Single registry example: Multiple registries example:

    Parameter reference:

    ParameterDescription
    nameA unique name for the service registry.
    prefixPrefix added to generated service entry names. For example, consul- produces entries like consul-web.
    typeRegistry type. Set to consul.
    endpointConsul server endpoint, such as http://consul-server.consul:8500.
    toNamespaceKubernetes namespace for generated service entries. If the namespace does not exist, it is created automatically.
       [
         {
           "name": "consul-test",
           "prefix": "consul-",
           "type": "consul",
           "endpoint": "http://consul-server.consul:8500",
           "toNamespace": "default"
         }
       ]
       [
         {
           "name": "consul-test01",
           "prefix": "consul01-",
           "type": "consul",
           "endpoint": "http://consul-server01.consul:8500",
           "toNamespace": "default"
         },
         {
           "name": "consul-test02",
           "prefix": "consul02-",
           "type": "consul",
           "endpoint": "http://consul-server02.consul:8500",
           "toNamespace": "default"
         }
       ]
  5. Run the following command to install ASM-se-syncer: After installation, ASM-se-syncer connects to the specified Consul registries and synchronizes all services registered in the Consul service registries to your ASM instance.

       helm install -f values.yaml se-syncer ./

Verify the connection

After installation, verify that the syncer is running and that Consul services appear as service entries in ASM.

  1. Verify the syncer Deployment.

    1. Log on to the ACK console. In the left-side navigation pane, click Clusters.

    2. On the Clusters page, click the cluster name. In the left-side pane, choose Workloads > Deployments.

    3. On the Deployments page, confirm that the asm-serviceregistry-syncer Deployment exists and is running.

    asm-serviceregistry-syncer Deployment

  2. Verify that service entries are synchronized.

    1. Log on to the ASM console. In the left-side navigation pane, choose Service Mesh > Mesh Management.

    2. Click the name of your ASM instance. In the left-side pane, choose Cluster & Workload Management > External Service(ServiceEntry).

    3. On the External Service(ServiceEntry) page, confirm that the Consul services appear as service entries.

    Note

    Service entries are named in the format <prefix><consul-service-name> and reside in the namespace specified by the toNamespace parameter.

Call Consul services from inside the mesh

After the ACK cluster that hosts the Consul service is added to the ASM data plane, use either of the following methods to call a Consul service.

Use the DNS proxy

  1. Enable the DNS proxy feature. For details, see Use the DNS proxy feature in an ASM instance.

  2. Get the hostname and port from the service entry:

    1. In the ASM console, choose Service Mesh > Mesh Management and click your ASM instance.

    2. Choose Cluster & Workload Management > External Service(ServiceEntry).

    3. Find the target service entry and click YAML in the Actions column.

    4. In the Edit dialog box, locate the hosts and ports fields.

    Hostname and port in the service entry YAML

  3. Call the service using http://<hostname>:<port>.

Use the endpoint address directly

  1. In the ASM console, navigate to the service entry as described in the DNS proxy method.

  2. In the service entry YAML, locate the endpoint address under spec.endpoints.

    Endpoint address in the service entry YAML

  3. Call the service using http://<endpoint-address>.

Disconnect from Consul

To stop synchronizing services from Consul, uninstall ASM-se-syncer:

helm uninstall se-syncer

After uninstallation, the syncer stops watching the Consul registries and no longer creates or updates service entries.

FAQ

How does the synchronization work?

ASM-se-syncer watches your Consul registries for changes. When a service is registered in Consul, the syncer creates a corresponding service entry in Istio. Updates and deletions are reflected automatically. No manual sync is needed after the initial setup.

Why are ASM services not visible to Consul-based consumers?

Synchronization is one-directional: Consul to ASM only. Services running inside ASM are not automatically registered in Consul. To make mesh services accessible to Consul-based consumers, manually register them in the Consul service registry.