You can use Application Monitoring eBPF Edition of Application Real-Time Monitoring Service (ARMS) to monitor applications that are deployed in Kubernetes environments in a non-intrusive manner. Application Monitoring eBPF Edition allows you to monitor applications based on the topology, interface calls, application overview, and alerts. This topic describes how to use Application Monitoring eBPF Edition to monitor an application in a Kubernetes environment.
This topic does not apply to Alibaba Cloud Container Service for Kubernetes (ACK) clusters. For information about how to monitor an application in an ACK cluster, see Manually connect an application to Application Monitoring eBPF Edition.
Prerequisites
The version of the Kubernetes cluster is 1.20 or later.
The cluster is accessible over the Internet, or a network connection is established between an Alibaba Cloud virtual private cloud (VPC) and the cluster by using a Cloud Enterprise Network (CEN) instance.
The x86 architecture is used, and the kernel version is 4.19 or later. For more environment requirements, see Requirements and limitations on operating systems of Application Monitoring eBPF Edition.
Step 1: Install Helm v3
For information about how to install Helm v3, see Helm documentation.
Step 2: Install the ack-arms-cmonitor agent
Application Monitoring eBPF Edition can monitor only the following types of applications: Deployment and StatefulSet. Connecting a Deployment application and a StatefulSet application requires the same steps. To enable Application Monitoring eBPF Edition to monitor a Deployment application, perform the following steps:
Run the following
wget
command to download the ack-arms-cmonitor installation package:wget 'https://aliacs-app-catalog.oss-cn-hangzhou.aliyuncs.com/charts-incubator/ack-arms-cmonitor-4.1.2.tgz'
Run the following command to decompress the ack-arms-cmonitor installation package:
tar xvf ack-arms-cmonitor-4.1.2.tgz
Change the environment variable IS_PUBLIC in the otel-collector-deployment.yaml file to
public
.Edit the values.yaml file in the installation package. Modify the following parameters based on your business requirements and save the file.
registry: registry-__ACK_REGION_ID__-vpc.ack.aliyuncs.com cluster_id: __ACK_CLUSTER_ID__ accessKey: __ACCESSKEY__ accessKeySecret: __ACCESSKEY_SECRET__ uid: "__ACK_UID__" region_id: __ACK_REGION_ID__
registry
: the image address.NoteIn the preceding example, the image address is used for virtual private clouds (VPCs). If your application is deployed on the Internet, use the following image address:
registry-__ACK_REGION_ID__.ack.aliyuncs.com
__ACK_REGION_ID__
: the region ID. For more information about the regions that support Application Monitoring eBPF Edition, see Supported regions.__ACK_CLUSTER_ID__
: the unique ID of the Kubernetes cluster. We recommend that you specify this parameter in the<uid>-<clusterid>
format.__ACCESSKEY__
and__ACCESSKEY_SECRET__
: the AccessKey ID and AccessKey secret of your Alibaba Cloud account. For more information about how to obtain the AccessKey ID and AccessKey secret of your Alibaba Cloud account, see Obtain an AccessKey pair.ImportantYou must make sure that the AliyunARMSFullAccess and AliyunSTSAssumeRoleAccess policies are attached to your Alibaba Cloud account.
__ACK_UID__
: the ID of your Alibaba Cloud account. To obtain the ID of your Alibaba Cloud account, you can move the pointer over the profile picture in the upper-right corner of the Alibaba Cloud Management Console.
Install the ack-arms-cmonitor agent.
Run the following command without opening the ack-arms-cmonitor installation package:
helm3 upgrade --install ack-arms-cmonitor ack-arms-cmonitor --namespace arms-prom --create-namespace
Step 3: Edit the YAML file of the application
Run the following command to view the YAML file of the Deployment application:
kubectl get deployment {Deployment application name} -o yaml
NoteIf you do not know the
name of the Deployment application
, run the following command to view all Deployment applications. You can find the required Deployment application in the results. Then, view the YAML file of the application.kubectl get deployments --all-namespace
Run the following command to edit the YAML file of the Deployment application:
kubectl edit deployment {Deployment application name} -o yaml
In the YAML file, add the following content to the spec.template.metadata parameter.
labels: armseBPFAutoEnable: "on" armseBPFCreateAppName: "<your-deployment-name>" # Replace <your-deployment-name> with the application name.
The following example shows a complete YAML file for creating a Deployment application in a Kubernetes environment and enabling Application Monitoring eBPF Edition to monitor the application:
After the preceding configurations are saved, the application automatically restarts and then the configurations take effect.
After 2 to 5 minutes, if your application appears on the ARMS console and specific monitoring data is reported, your application is monitored by Application Monitoring eBPF Edition.
page in the
References
After you connect an application deployed in a Kubernetes environment to Application Monitoring eBPF Edition, you can view the metrics, upstream and downstream dependencies, and topology of the application. For more information, see Application details.