After you install an Application Real-Time Monitoring Service (ARMS) agent (ack-onepilot) for a Java application that is deployed in Container Service for Kubernetes (ACK), ARMS starts to monitor the Java application. You can view the monitoring data of application topology, API requests, abnormal transactions, and slow transactions. This topic describes how to install an ARMS agent for Java applications that are deployed in ACK.
Prerequisites
An ACK cluster is created. You can create an ACK dedicated cluster, ACK managed luster, or ACK Serverless cluster based on your business requirements.
A namespace is created in the cluster. For more information, see Manage namespaces and resource quotas. The namespace used in this example is arms-demo.
The version of the JDK is supported by Application Monitoring. For more information, see Java components and frameworks supported by ARMS.
Step 1: Install an ARMS agent
The old Application Monitoring agent arms-pilot is no longer maintained. You can install the new agent ack-onepilot to monitor your applications. ack-onepilot is fully compatible with arms-pilot. You can seamlessly install ack-onepilot without the need to modify application configurations. For more information, see How do I install ack-onepilot and uninstall arms-pilot?
Log on to the ACK console.
In the left-side navigation pane of the ACK console, click Clusters. On the Clusters page, click the name of the cluster.
In the left-side navigation pane, choose . On the Add-ons page, enter ack-onepilot in the upper-right corner.
Click Install on the ack-onepilot card.
NoteBy default, the ack-onepilot component supports 1,000 pods. For every additional 1,000 pods in the cluster, you need to add 0.5 CPU cores and 512 MB memory for the component.
In the dialog box that appears, configure the parameters and click OK. We recommend that you use the default values.
NoteAfter you install ack-onepilot, you can upgrade, configure, or uninstall it on the Add-ons page.
Step 2: Grant the cluster the permissions to access ARMS
To monitor applications in a serverless Kubernetes (ASK) cluster or applications in a Kubernetes cluster connected to Elastic Container Instance (ECI), you must first authorize the cluster to access ARMS on the Cloud Resource Access Authorization page. Then, restart all pods on which the ack-onepilot agent is deployed.
If you want to monitor applications in an ACK cluster with no ARMS Addon Token, perform the following operations to authorize the ACK cluster to access ARMS. If ARMS Addon Token exists, go to Step 3.
NoteIf a cluster has ARMS Addon Token, ARMS performs password-free authorization on the cluster. ARMS Addon Token may not exist in some ACK managed clusters. We recommend that you check whether an ACK managed cluster has ARMS Addon Token before you use ARMS to monitor applications in the cluster. If the cluster has no ARMS Addon Token, you must manually authorize the cluster to access ARMS.
Log on to the ACK console.
In the left-side navigation pane, click Clusters. On the Clusters page, click the name of the cluster.
On the details page of the cluster, click the Cluster Resources tab. On the tab, click the hyperlink next to Worker RAM Role.
On the Permissions tab, click Grant Permission.
Select the AliyunARMSFullAccess policy and click OK.
Step 3: Enable Application Monitoring to monitor a Java application
To enable Application Monitoring when you create an application, perform the following steps:
Log on to the ACK console. In the left-side navigation pane, click Clusters. On the Clusters page, find the cluster that you want to manage, and click Applications in the Actions column.
On the Deployments page, click Create from YAML in the upper-right corner of the page.
On the page that appears, select a template from the Sample Template drop-down list, and add the following
labels
to the spec > template > metadata section in the Template code editor: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.
NoteFor more information about Application Security, see What is Application Security?
For more information about the billing rules of Application Security, see Billing rules.
The following YAML template shows how to create a Deployment application and enable Application Monitoring for the application:
View the result
On the Deployments page, find the application that you want to monitor, and check whether the ARMS Console button appears in the Actions column.