This topic describes how to create a Prometheus instance for Container Service instance (Prometheus instance for Container Service). The instance allows you to monitor a Container Service for Kubernetes (ACK) cluster by using Managed Service for Prometheus. 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 Managed Service for Prometheus:

Method 1: Enable Managed Service for Prometheus by setting cluster parameters

  1. Log on to the ACK console or the ARMS console. Perform the following steps:
    • Use the ACK console:
      1. Log on to the ACK console.
      2. In the left-side navigation pane, click Clusters.
    • Use the ARMS console or Managed Service for Prometheus console:
      1. Log on to the ARMS console.
      2. In the left-side navigation pane, choose Prometheus Service > Prometheus Instances.
      3. Click Create Prometheus Instance. On the page that appears, click Prometheus Instance for Container Service.
      4. In the panel that appears, find the ACK cluster and click Install in the Actions column. Set the Billing Method parameter for the instance. Then, click OK.
  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 Managed Service for Prometheus.

Method 2: Enable Managed Service for Prometheus 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. On the Prometheus Monitoring page, click Install.
    After you install the Prometheus agent, the arms-prom page appears. You can view the application information on this page. arm-prom

After you enable Managed Service for Prometheus for an ACK cluster, a Prometheus instance is automatically created and displayed on the Prometheus Monitoring page in the Managed Service for Prometheus 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 Managed Service for Prometheus, 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 Service > Prometheus Instances.
  3. Click the name of the Prometheus instance that you want to manage. In the left-side navigation pane of the page that appears, click Dashboards.
  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 Managed Service for Prometheus, you can perform the following steps to uninstall the Managed Service for Prometheus agent:

  1. Log on to the ARMS console.
  2. In the left-side navigation pane, choose Prometheus Service > Prometheus Instances.
  3. On the Prometheus Service page, find the Prometheus instance that you want to uninstall and click Uninstall in the Actions column. In the message that appears, click OK.
    After you uninstall a Prometheus instance, it is no longer displayed on the Prometheus instance page.
  4. Log on to the ACK console.
  5. 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.
  6. 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