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 Service agent
    Note The metrics of Kubernetes Monitoring are collected by Prometheus Service. Therefore, you must install the Prometheus Service agent. For more information about the relationship between Kubernetes Monitoring and Prometheus Service, see Comparison between Kubernetes Monitoring and other ARMS services.
  • The Kubernetes Monitoring agent

    Before you install the Kubernetes Monitoring agent, you must check whether ARMS Addon Token exists in the Kubernetes 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 name.
    3. In the left-side navigation pane, choose Configurations > 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 following policies 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 the Kubernetes Monitoring agent:

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

  1. Install the Prometheus Service 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 Service agent is not installed, install the Prometheus Service agent. Install the Prometheus Service agent
    5. On the Prometheus Monitoring page, click Install.
      ACK automatically installs the Prometheus Service 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 on the Kubernetes Monitoring page in the ARMS console

  1. Install the Prometheus Service 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 the Kubernetes cluster is deployed.
    4. On the Kubernetes Monitoring page, click Install in the Operation column of the Kubernetes cluster.
    5. In the Exporters dialog box, click Install in the Operation column of Prometheus Monitoring.
      You are redirected to the details page of the Prometheus Service agent in the ACK console.
    6. In the Deploy panel on the right side of the page, select the Kubernetes cluster that you want to manage, and click Create.
      Note The default namespace is arms-prom.
  2. Install the ARMS Kubernetes Monitoring agent.
    1. On the Kubernetes Monitoring page, click Install in the Operation column of the Kubernetes cluster.
    2. In the Exporters dialog box, click Install in the Operation column of Kubernetes Monitoring.
      You are redirected to the details page of the Kubernetes Monitoring agent in the ACK console.
    3. In the Deploy panel on the right side of the details page of the Kubernetes Monitoring agent, select the Kubernetes cluster that you want to manage, and click Create.
      Note The default namespace is arms-prom.
  3. Optional:Install the ARMS Application Monitoring agent.
    1. On the Kubernetes Monitoring page, click Install in the Operation column of the Kubernetes cluster.
    2. In the Exporters dialog box, click Install in the Operation column of Application Monitoring.
      You are redirected to the details page of the Application Monitoring agent in the ACK console.
    3. In the Deploy panel on the right side of the page, select the Kubernetes cluster that you want to manage, and click Create.
      Note The default namespace is arms-pilot.