The public preview of Alibaba Cloud Kubernetes Monitoring starts on June 18, 2021. During the public preview, you can use Kubernetes Monitoring free of charge. If you have questions, contact the Kubernetes Monitoring DingTalk group 35568145 to request technical support. This topic describes how to install the Kubernetes Monitoring agent.

Prerequisites

Description

To enable Kubernetes Monitoring for a Kubernetes cluster, install the following agents:

  • The Prometheus Monitoring agent
    Note The metrics of Kubernetes Monitoring are collected by Prometheus Monitoring. Therefore, you must install the Prometheus Monitoring agent. For more information about the relationship between Kubernetes Monitoring and Prometheus Monitoring, see Comparison between Kubernetes Monitoring and other ARMS services.
  • The Kubernetes Monitoring agent

    Before you install Kubernetes Monitoring agent, you must check whether ARMS Addon Token exists in the cluster that you want to manage. If ARMS Addon Token does not exist, an error occurs due to insufficient permissions. If ARMS Addon Token exists, ARMS performs password-free authorization. After the agent is installed, you can use Kubernetes Monitoring. If ARMS Addon Token does not exist, you must attach permission policies on ARMS and Tracing Analysis to the RAM role.

    The following section describes how to check whether ARMS Addon Token exists and how to attach permission policies:

    1. Log on to the ACK console.
    2. On the Clusters page, find the cluster that you want to manage and click the cluster ID.
    3. In the left-side navigation pane, choose Configuration Management > Secrets.
    4. In the upper part of the page, select kube-system from the Namespace drop-down list and check whether addon.arms.token exists.
    1. Log on to the ACK console.
    2. In the left-side navigation pane of the ACK console, click Clusters.
    3. On the Clusters page, click the name of the cluster that you want to manage.
    4. In the left-side navigation pane, click Cluster Information. On the page that appears, click the Cluster Resources tab.
    5. On the Cluster Resources tab, click the link on the right side of Worker RAM Role.
    6. On the Permissions tab, click Add Permissions.
    7. In the Select Policy section of the Add Permissions panel, enter the keywords of the two policies that you want to attach to the RAM role in the search box. Click the policies to add them to the Selected list on the right side of the section. Then, click OK.
      • AliyunTracingAnalysisFullAccess: grants full permissions on Tracing Analysis.
      • AliyunARMSFullAccess: grants full permissions on ARMS.

    Note
    • ARMS Addon Token may not exist in some ACK managed clusters. If you use an ACK managed cluster, we recommend that you first check whether ARMS Addon Token exists. If ARMS Addon Token does not exist, you must manually grant permissions.
    • By default, ACK dedicated clusters do not have ARMS Addon Token. You must manually grant permissions.
    • By default, registered clusters do not have ARMS Addon Token. You must manually grant permissions. Registered clusters do not have a worker RAM role. You cannot manually attach permission policies on ARMS and Tracing Analysis to the RAM role. For more information about how to install the Kubernetes Monitoring agent for a registered cluster, see Install the agent for a registered cluster.

Use one of the following methods to install Monitoring agent:

Method 1: Enable Kubernetes Monitoring on the Cluster Topology page in the ACK console

  1. Install the Prometheus Monitoring agent.
    1. Log on to the ACK console.
    2. In the left-side navigation pane, click Clusters.
    3. On the Clusters page, click the name of the cluster that you want to manage, or click Details in the Actions column of the cluster.
    4. In the left-side navigation pane of the cluster details page, choose Operations > Prometheus Monitoring.
      If the Prometheus Monitoring page shows that the Prometheus Monitoring agent is not installed, install the Prometheus Monitoring agent. Install the Prometheus Monitoring agent
    5. On the Prometheus Monitoring page, click Install.
      ACK automatically installs the Prometheus Monitoring agent.
      Note The default namespace is arms-prom.
  2. Install the Kubernetes Monitoring agent.
    1. In the left-side navigation pane, choose Operations > Cluster Topology.
    2. On the Cluster Topology page, click Install.
      ACK automatically installs the Kubernetes Monitoring agent.
      Note The default namespace is arms-pilot.

Method 2: Enable Kubernetes Monitoring in the ARMS Kubernetes Monitoring console

  1. Install the Prometheus Monitoring agent.
    1. Log on to the ARMS console.
    2. In the left-side navigation pane, click Kubernetes Monitoring.
    3. In the top navigation bar, select the region where your cluster is deployed.
    4. On the Kubernetes Monitoring page, click Install in the Operation column of the cluster.
    5. In the Exporters dialog box, click Install in the Operation column of Prometheus Monitoring.
      You are redirected to the details page of ack-arms-prometheus in the ACK console.
    6. In the Deploy panel on the right side of the page, select the cluster that you want to manage and click Create.
      Note The default namespace is arms-prom.
  2. Install the Kubernetes Monitoring agent.
    1. On the Kubernetes Monitoring page, click Install in the Operation column of the cluster.
    2. In the Exporters dialog box, click Install in the Operation column of Kubernetes Monitoring.
      You are redirected to the details page of ack-arms-cmonitor in the ACK console.
    3. In the Deploy panel on the right side of the page, select the cluster that you want to manage and click Create.
      Note The default namespace is arms-prom.
  3. Optional:Install the Application Monitoring agent.
    1. On the Kubernetes Monitoring page, click Install in the Operation column of the cluster.
    2. In the Exporters dialog box, click Install in the Operation column of Application Monitoring.
      You are redirected to the details page of ack-arms-pilot in the ACK console.
    3. In the Deploy panel on the right side of the page, select the cluster that you want to manage and click Create.
      Note The default namespace is arms-pilot.