For Java applications deployed in Container Service for Kubernetes (ACK) clusters, you can install the ack-onepilot component of Application Real-Time Monitoring Service (ARMS). This feature automatically discovers application topology, generates 3D topology maps, monitors interfaces, and captures exceptions and slow transactions, significantly improving the efficiency of diagnosing production issues.
Background
Application Real-Time Monitoring Service (ARMS) is an application performance management (APM) product from Alibaba Cloud. For Java applications deployed in Container Service for Kubernetes (ACK), you can install and authorize the ack-onepilot application monitoring component to enable comprehensive monitoring without modifying any application code. This helps you quickly identify faulty and slow interfaces, reproduce call parameters, detect memory leaks, and discover system bottlenecks, greatly improving the efficiency of diagnosing production issues. For more information about application monitoring, see What is application monitoring?.
Prerequisites
-
A namespace is available. For more information, see Manage namespaces and resource quotas. This topic uses the
arms-demonamespace as an example. -
The version of the JDK is supported by Application Monitoring. ARMS supports the following JDK versions:
-
JDK 1.7.0+
ImportantThe ARMS agent V3.0.X and later will no longer support Java 7. If you are still using Java 7, we recommend that you upgrade your Java version. For more information, see Application Monitoring no longer supports Java 7.
-
JDK 1.8.0_25+
Note-
If you deploy applications in Kubernetes clusters, we recommend that you use JDK V1.8.0_191 or later.
-
Make sure that the JDK version is not 1.8.0_25 or 1.8.0_31. Otherwise, the ARMS agent may fail to be installed. In this case, we recommend that you upgrade JDK to the latest 1.8.X.
-
-
JDK 11.0.8+
-
JDK 17
-
Step 1: Install the ARMS application monitoring component
The legacy arms-pilot component is no longer maintained. You can install its successor, ack-onepilot, to monitor your applications. ack-onepilot is fully compatible with arms-pilot, ensuring a seamless transition without any changes to your application configuration. For more information, see How do I uninstall arms-pilot and install ack-onepilot?.
Log on to the ACK console. In the left navigation pane, click Clusters.
On the Clusters page, click the name of your cluster. In the left navigation pane, click Components and Add-ons.
-
In the Logs and Monitoring section, find the
ack-onepilotcomponent and click Install on its card. In the dialog box, configure the parameters. We recommend that you use the default values. Click OK to complete the installation.NoteBy default, the
ack-onepilotcomponent supports up to 1,000 pods. For every additional 1,000 pods in the cluster, increase the CPU resources forack-onepilotby 0.5 cores and the memory by 512 MB.After the installation is complete, you can upgrade, configure, or uninstall the ack-onepilot component on the Add-ons page.
Step 2: Grant permissions to access ARMS resources
-
If you need to monitor ACK cluster applications but the
addon.arms.tokendoes not exist in the ACK cluster, perform the following operations to manually grant the cluster access to ARMS resources. If theaddon.arms.tokenalready exists, this authorization is not required.NoteWhen an ACK cluster contains the
addon.arms.token, ARMS can automatically complete the password-free authorization process. Typically, ACK managed clusters include theaddon.arms.tokenby default. However, some older ACK managed clusters might be missing theaddon.arms.token.-
Check whether the
addon.arms.tokenSecret exists. -
If the
addon.arms.tokenSecret exists, no further action is required. Otherwise, follow these steps to manually grant the cluster permissions to access ARMS resources.Log on to the ACK console. In the left navigation pane, click Clusters.
On the Clusters page, click the name of your cluster. In the left navigation pane, click Cluster Information.
-
On the Basic Information tab, find the Cluster Resources section and click the link next to Worker RAM Role.
-
On the Role page, click the Permissions tab and then click Add Permissions.
-
Select the AliyunARMSFullAccess policy and click OK.
-
-
To monitor applications in an ACK managed cluster that is integrated with Elastic Container Instance (ECI), go to the RAM Quick Authorization page to complete the authorization, and then restart all pods of the
ack-onepilotcomponent.
Step 3: Enable ARMS for a Java application
To enable ARMS application monitoring for a new application, follow these steps.
Log on to the ACK console. In the left navigation pane, click Clusters.
On the Clusters page, click the name of your cluster. In the left navigation pane, click .
-
On the Deployments page, click Create from YAML.
-
Select Sample Template, and in the Template (YAML format), add the following
labelsto the spec.template.metadata section.labels: armsPilotAutoEnable: "on" armsPilotCreateAppName: "<your-deployment-name>" # Replace <your-deployment-name> with the actual application name. armsSecAutoEnable: "on" # If you want to connect the application to Application Security, you must configure this parameter.Note-
For more information about application security, see What is application security?.
-
For more information about billing for application security, see Billing.
In the pod template of the Deployment, enable ARMS application monitoring by adding the
armsPilotAutoEnable: "on"andarmsPilotCreateAppName: "arms-k8s-demo"labels. The following code is a sample YAML file:apiVersion: v1 kind: Namespace metadata: name: arms-demo --- apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1 kind: Deployment metadata: name: arms-springboot-demo namespace: arms-demo labels: app: arms-springboot-demo spec: replicas: 2 selector: matchLabels: app: arms-springboot-demo template: metadata: labels: app: arms-springboot-demo armsPilotAutoEnable: "on" armsPilotCreateAppName: "arms-k8s-demo" spec: containers: - resources: limits: # ...The following sample YAML file creates a Deployment and enables ARMS application monitoring.
-
Next steps
After you complete these steps, you have enabled ARMS application monitoring for the application in the ACK cluster. On the Deployments page, find the target application. In the Actions column, click the to view application monitoring details. For more information, see application overview.
> ARMS Console