Updated on 2024-08-05 GMT+08:00

Configuring Service Discovery for CCE Clusters

By adding ServiceMonitor or PodMonitor, you can configure Prometheus collection rules to monitor the applications deployed in CCE clusters.

Prerequisite

Both your service and CCE cluster have been connected to a Prometheus instance for CCE. For details, see Prometheus Instance for CCE.

Precautions

Only when kube-prometheus-stack installed on the Add-ons page of CCE or the Integration Center page of AOM is 3.9.0 or later and is still running, can you enable or disable collection rules.

To view the kube-prometheus-stack status, log in to the CCE console and access the cluster page, choose Add-ons in the navigation pane, and locate that add-on on the right.

Adding ServiceMonitor

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane on the left, choose Metric Analysis > Prometheus Monitoring.
  3. In the instance list, click a Prometheus instance for CCE.
  4. In the navigation pane on the left, choose Service Discovery. On the Settings tab page, click ServiceMonitor.
  5. Click Add ServiceMonitor. In the displayed dialog box, set related parameters and click OK.

    After the configuration is complete, the new collection rule is displayed in the service discovery list.

Adding PodMonitor

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane on the left, choose Metric Analysis > Prometheus Monitoring.
  3. In the instance list, click a Prometheus instance for CCE.
  4. In the navigation pane on the left, choose Service Discovery. On the Settings tab page, click PodMonitor.
  5. Click Add PodMonitor. In the displayed dialog box, set related parameters and click OK.

    After the configuration is complete, the new collection rule is displayed in the service discovery list.

More Operations

Perform the operations listed in Table 1 if needed.

Table 1 Related operations

Operation

Description

Viewing service discovery

  • In the service discovery list, view information such as the name, tag, namespace, and configuration mode. You can filter information by cluster name, namespace, or configuration mode.
  • Click in the Operation column. In the displayed dialog box, view details about the ServiceMonitor or PodMonitor collection rule.

Enabling or disabling collection rules

On the Settings tab page of the Service Discovery page, click in the Status column to enable or disable collection rules. indicates that collection rules are disabled. indicates that collection rules are enabled.

Deleting service discovery

Click in the Operation column.