All Products
Search
Document Center

Microservices Engine:Connect ACK and ACS microservice applications to the MSE governance center (Java)

Last Updated:Mar 11, 2026

Microservices Engine (MSE) governance adds traffic management, canary releases, graceful startup and shutdown, and throttling to your Spring Cloud and Dubbo applications -- without code changes. This guide walks you through connecting applications deployed in Container Service for Kubernetes (ACK) or Container Compute Service (ACS) to the MSE governance center.

How it works

MSE uses the ack-onepilot component to inject a Java agent into your application pods automatically. The agent connects each pod to the MSE governance center.

You enable governance at one of two levels:

ApproachWhen to useWhat happens
Namespace-level accessAll or most applications in a namespace need governanceEvery new or redeployed pod in the namespace is automatically connected
Single-application accessOnly a few applications need governanceYou explicitly opt in each application through YAML labels

Prerequisites

Before you begin, make sure that you have:

Verify cluster permissions

The ACK cluster must have permissions to access MSE resources. If the cluster has an ARMS add-on token, MSE grants password-free authorization automatically. ACK managed clusters include this token by default, but some older clusters may not.

To check for the ARMS add-on token:

  1. Log on to the Container Service for Kubernetes console. On the Clusters page, click the target cluster name.

  2. In the left-side navigation pane, choose Configuration Management > Secrets.

  3. Set Namespace to kube-system and look for addon.arms.token.

If the token does not exist, you must manually grant the required permissions.

Important
  • If your project uses the open-source Sentinel component together with com.alibaba.cloud.sentinel.feign.SentinelFeignAutoConfiguration, the connection to the MSE governance center fails.

  • After ack-onepilot is installed, the injected agent may increase application startup time by up to 10 seconds.

Enable governance for all applications in a namespace

After you enable governance at the namespace level, every new or redeployed pod in that namespace connects to the MSE governance center automatically. No per-application configuration is required.

  1. Log on to the MSE console and select a region in the top navigation bar.

  2. In the left-side navigation pane, choose Microservices Governance > Application Governance.

  3. On the Application list page, click ACK Application Access.

  4. In the ACK Application Access dialog box, configure the following parameters, and then click OK.

Namespace access dialog
ParameterDescription
Cluster typeSelect ACK Cluster, ACK Serverless Cluster, or ACS Cluster. If you have not authorized Container Service for Kubernetes to call MSE, click Please Authorize to grant the AliyunCSManagedMseRole role.
Cluster Name/IDSelect the cluster to connect. Search by keyword if needed.
ack-onepilotDisplays the component status. If ack-onepilot is installed, the console displays "Installed" followed by the version number, for example, Installed 4.2.0. If ack-onepilot is not installed, the system installs it automatically when you select the cluster. If your RAM user does not have the required permissions, install it manually: open the Container Service for Kubernetes console, go to the cluster details page, click Add-ons, find ack-onepilot, and click Install. For version details, see ack-onepilot component and Install and upgrade the MSE microservice governance component.
Access TypeSelect Namespace Access.
Cluster NamespaceSelect the namespace that contains your applications.
Microservices Governance NamespaceSelect the MSE governance namespace to associate with your cluster namespace.
Note

If you connect by namespace and your cluster is not in one of the following regions, it must have Internet access and be able to connect to acm.aliyun.com:8080: China (Qingdao), China (Hangzhou), China (Beijing), China (Shanghai), Shanghai-Finance Cloud, China (Shenzhen), Hong Kong (China), Singapore, Germany (Frankfurt), Australia (Sydney), US (Silicon Valley), and US (Virginia).

Customize the application display name

By default, the MSE console uses the deployment name as the application display name. To set a custom name, add the following labels to the deployment YAML:

spec:
  template:
    metadata:
      labels:
        # MSE governance namespace. Default: default
        mseNamespace: default
        # Custom application name displayed in the MSE console
        msePilotCreateAppName: "your-deployment-name"

Exclude an application from namespace-level governance

To opt out a specific application from namespace-level governance, add the msePilotAutoEnable label set to "off":

spec:
  template:
    metadata:
      labels:
        # Disable MSE governance for this application. The value must be quoted.
        msePilotAutoEnable: "off"

Enable governance for a single application

If only a few applications in your namespace need governance, connect them individually rather than enabling namespace-level access.

  1. Log on to the MSE console and select a region in the top navigation bar.

  2. In the left-side navigation pane, choose Microservices Governance > Application Governance.

  3. On the Application list page, click ACK Application Access.

  4. In the ACK Application Access dialog box, configure the following parameters, and then click OK.

Single application access dialog
ParameterDescription
Cluster typeSelect ACK Cluster, ACK Serverless Cluster, or ACS Cluster. If you have not authorized Container Service for Kubernetes to call MSE, click Please Authorize to grant the AliyunCSManagedMseRole role.
Cluster Name/IDSelect the cluster to connect. Search by keyword if needed.
ack-onepilotDisplays the component status. If ack-onepilot is installed, the console displays "Installed" followed by the version number, for example, Installed 4.2.0. If ack-onepilot is not installed, the system installs it automatically when you select the cluster. If your RAM user does not have the required permissions, install it manually: open the Container Service for Kubernetes console, go to the cluster details page, click Add-ons, find ack-onepilot, and click Install.
Access TypeSelect Single Application Access.
  1. Configure the application deployment YAML in the Container Service for Kubernetes console:

    1. Go to Workloads > Deployments and switch to the namespace of your application.

    2. Find the target application and click View In YAML.

    3. Add the following labels and click Update:

spec:
  template:
    metadata:
      labels:
        # Enable MSE governance. The value must be quoted.
        msePilotAutoEnable: "on"
        # MSE governance namespace. If the namespace does not exist, it is created automatically.
        mseNamespace: default
        # Application name displayed in the MSE console. Must be quoted.
        msePilotCreateAppName: "your-deployment-name"

Verify the connection

After completing the configuration, restart your application and verify the connection:

  1. Log on to the MSE console and select a region in the top navigation bar.

  2. In the left-side navigation pane, choose Microservices Governance > Application Governance.

  3. Select the target microservices governance namespace from the namespace dropdown.

  4. Confirm that your application appears in the list with an active status.

If your application does not appear, check the following:

SymptomPossible causeResolution
Application not listedApplication was not restarted after configurationRestart or redeploy the application
Application not listedack-onepilot is not installed or not runningOpen the ACK console, go to Add-ons, and verify ack-onepilot status
Application not listedCluster and MSE governance center are in different regionsCreate a new cluster in the same region or select the matching region in the MSE console
Application not listedJVM heap memory is below 256 MBIncrease the JVM heap memory to at least 256 MB
Connection failsProject uses the Sentinel component with SentinelFeignAutoConfigurationRemove the Sentinel auto-configuration from your project

What to do next

With your application connected to the MSE governance center, you can use features such as end-to-end canary release, graceful startup and shutdown, and traffic throttling. For more information, see Get started with service governance in 15 minutes (Java).

YAML label reference

LabelValuesPurpose
msePilotAutoEnable"on" / "off"Enable or disable MSE governance for a specific application
mseNamespaceAny string (default: default)MSE governance namespace for the application
msePilotCreateAppNameAny stringCustom application display name in the MSE console
Note

All label values that contain lowercase alphabetic strings (such as "on" and "off") must be enclosed in double quotes in the YAML file to prevent them from being interpreted as booleans.