This topic describes how to create a Prometheus instance to monitor a Container Service for Kubernetes (ACK) cluster. After you create a Prometheus instance, you can use preset dashboards to monitor the host and view the performance metrics of the ACK cluster.

Prerequisites

Create a Prometheus instance

You can use one of the following methods to enable Prometheus Service:

Enable Prometheus Service by setting ACK cluster parameters

  1. Log on to the ACK console or the ARMS console. Perform the following operations:
    • Use the ACK console:
      1. Log on to the ACK console.
      2. In the left-side navigation pane of the ACK console, click Clusters.
    • Use the ARMS console or Prometheus Service console:
      1. Log on to the ARMS console.
      2. In the left-side navigation pane, choose Prometheus Monitoring > Prometheus Instances.
      3. In the top navigation bar of the Prometheus Monitoring page, select a region. Then, click Create Prometheus instance in the upper-right corner of the page.
      4. On the Create Prometheus instance page, click Prometheus Instance for Container Service.
      5. In the Integrate Container Service for Kubernetes Cluster panel, find the ACK cluster that you want to manage and click Install in the Actions column. In the dialog box that appears, click OK or Install ack-arms-prometheus.
  2. In the upper-right corner of the Clusters page, click Create Kubernetes Cluster.
  3. Select the cluster template that you want to use and set the cluster parameters. In the Component Configurations step, select Enable Prometheus Monitoring.
    Component ConfigurationsFor more information about how to create an ACK cluster, see Create an ACK managed cluster.
    Note By default, Enable Prometheus Monitoring is selected when you create an ACK cluster.
    After the ACK cluster is created, the system automatically configures Prometheus Service.

Enable Prometheus Service on the Prometheus Monitoring page in the ACK console

  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, find the cluster that you want to manage and click the name of the cluster or click Details in the Actions column. The details page of the cluster appears.
  4. In the left-side navigation pane of the cluster details page, choose Operations > Prometheus Monitoring.
  5. In the middle of the Prometheus Monitoring page, click Install.

Result

After you install the Prometheus agent, the arms-prom page appears. You can view application information on this page. arm-prom

After you enable Prometheus Service for an ACK cluster, a Prometheus instance is automatically created and displayed on the Prometheus Monitoring page in the Prometheus Service console. Prometheus for Container Service is displayed in the Instance Type column of the Prometheus instance.

View monitoring metrics on a Grafana dashboard

After you connect an ACK cluster to Prometheus Service, you can view the performance metrics of the cluster on a Grafana dashboard.

  1. Log on to the ARMS console .
  2. In the left-side navigation pane, choose Prometheus Monitoring > Prometheus Instances.
  3. In the top navigation bar of the Prometheus Monitoring page, select a region. Then, click the name of the Prometheus instance that you want to manage.
  4. On the Dashboards page, click the name of a dashboard to view the performance metrics of the cluster.

Disable monitoring for an ACK cluster

If you no longer want to monitor an ACK cluster by using Prometheus Service, you can perform the following steps to uninstall the Prometheus agent:

  1. Log on to the ARMS console .
  2. In the left-side navigation pane, choose Prometheus Monitoring > Prometheus Instances.
  3. In the top navigation bar of the Prometheus Monitoring page, select the region where the ACK cluster resides. Then, find the Prometheus instance that monitors the ACK cluster and click Uninstall in the Actions column.
  4. In the message that appears, click OK.
  5. Log on to the ACK console.
  6. In the left-side navigation pane, click Clusters. On the Clusters page, find the cluster for which you want to disable monitoring and click its name.
  7. In the left-side navigation pane, choose Applications > Helm. Perform one of the following operations as needed:
    • If no record in the arms-prom-**** format is displayed on the Helm page, the Prometheus agent is uninstalled. In this case, you do not need to perform more operations.
    • If a record in the arms-prom-**** format is displayed on the Helm page, click Delete in the Actions column. ack_pg_release