Application Real-Time Monitoring Service (ARMS) monitors application topology, API calls, slow and abnormal transactions, and SQL queries for Java applications in general-purpose Kubernetes environments. This topic describes how to install the ARMS agent in a non-ACK Kubernetes cluster to enable automatic instrumentation.
If your Kubernetes cluster runs on Container Service for Kubernetes (ACK), see Install the Java agent for ACK and ACS using the ack-onepilot component instead.
Prerequisites
Before you begin, make sure that you have:
-
A Kubernetes cluster running version 1.18 or later
-
Public network access from the cluster (for non-Alibaba Cloud clusters), or a Cloud Enterprise Network (CEN) connection to an Alibaba Cloud VPC
Your JDK version is supported by Application Monitoring
The JVM maximum heap memory (
-Xmx) is at least 256 MB
Choose an installation method
Two methods are available. Method 1 is recommended because it provides more efficient O&M support, full monitoring capabilities, and access to additional cluster extensions.
| Method | Best for | Limitations |
|---|---|---|
| Method 1: Register the cluster with ACK One (recommended) | More efficient O&M support, full monitoring capabilities including container-level metrics (CPU, memory, disk, network), and access to ACK extensions such as logging, backup, and security | Requires registering the cluster with ACK One |
| Method 2: Connect directly to ARMS | Lightweight setup without cluster registration | Container-level metrics (CPU, memory, disk, network) are not available. Only ARMS-collected data is shown on the Application Instances page. Container data from Managed Service for Prometheus is not accessible. |
Method 1: Register the cluster with ACK One (recommended)
Registering your Kubernetes cluster with Distributed Cloud Container Platform for Kubernetes (ACK One) provides more efficient O&M support and gives you access to monitoring, logging, backup and restore, security, and elastic cloud resources. For details, see Overview of registered clusters.
-
Register your Kubernetes cluster with ACK One. See Create a registered cluster of ACK One.
-
Install the ack-onepilot component for the registered cluster. See Connect ARMS to a registered cluster.
Method 2: Connect directly to ARMS
With this method, container metrics such as CPU, memory, disk, and network usage are not available on the Application Instances page. Only data collected by ARMS is shown. Container data from the Prometheus agent through Managed Service for Prometheus is not accessible. For details, see Java application instance monitoring.
Step 1: Install Helm 3
Install Helm 3 on your local machine. See the Helm installation guide.
Step 2: Install the ack-onepilot agent
ARMS supports both Deployment (stateless) and StatefulSet (stateful) workloads. The installation steps are identical for both.
-
Download the ack-onepilot Helm chart.
wget 'https://aliacs-app-catalog.oss-cn-hangzhou.aliyuncs.com/charts-incubator/ack-onepilot-5.1.1.tgz' -
Extract the chart.
tar xvf ack-onepilot-5.1.1.tgz -
Edit
ack-onepilot/values.yamland configure the following parameters.registry: registry-<region-id>.ack.aliyuncs.com/acs/ cluster_id: <cluster-id> accessKey: <your-access-key-id> accessKeySecret: <your-access-key-secret> uid: "<your-account-id>" region_id: <region-id>Replace the following placeholders with your actual values:
Placeholder Description Where to find it <region-id>Alibaba Cloud region ID, such as cn-hangzhouSee Supported regions <cluster-id>A unique identifier for the Kubernetes cluster. Use the format <your-account-id>-<clusterid>.Define a custom ID <your-access-key-id>AccessKey ID of your Alibaba Cloud account See Create an AccessKey pair <your-access-key-secret>AccessKey secret of your Alibaba Cloud account See Create an AccessKey pair <your-account-id>Alibaba Cloud account ID Hover over your profile picture in the upper-right corner of the Alibaba Cloud Management Console Important-
The account must have the AliyunARMSFullAccess and AliyunSTSAssumeRoleAccess permissions. If you use a Resource Access Management (RAM) user, grant the same permissions to that user. See Grant permissions to a RAM user.
-
To avoid storing credentials in plain text, use a Kubernetes Secret. See Import the AccessKey pair using a Kubernetes Secret.
NoteFor edge clusters, add a
nodeSelectorto schedule ack-onepilot on cloud nodes instead of edge nodes.kind: Deployment apiVersion: apps/v1 metadata: name: xxx namespace: xxx spec: template: spec: nodeSelector: # Replace with your actual node selector. alibabacloud.com/is-edge-worker: "false" -
-
From the directory that contains the
ack-onepilotfolder (not from inside it), run the Helm install command.Run this command outside the ack-onepilot installation package.
helm3 upgrade --install ack-onepilot ack-onepilot --namespace ack-onepilot --create-namespace
Step 3: Label your application for auto-instrumentation
After ack-onepilot is installed, label your application pods so that the agent is automatically injected.
-
Find the deployment name of your application.
kubectl get deployments --all-namespaces -
(Optional) View the current YAML configuration.
kubectl get deployment <deployment-name> -o yaml -
Edit the deployment.
kubectl edit deployment <deployment-name> -o yaml -
Add the following labels under spec.template.metadata.labels:
labels: armsPilotAutoEnable: "on" armsPilotCreateAppName: "<your-app-name>" # The name shown in ARMS Application Monitoring. aliyun.com/app-language: javaNoteFor more information about application security, see What is application security?.
For more information about application security billing, see Billing overview.
-
Save the file. The application restarts automatically.
After the application restarts, wait 2 to 5 minutes for data to appear. Then verify the connection:
The following YAML creates a sample Spring Boot application with ARMS monitoring enabled:
Verify the connection
-
Log on to the ARMS console.
-
In the left-side navigation pane, choose .
-
Confirm that your application is listed and reporting data.
If the application appears and reports data, the agent installation is complete.