Help Center/ Cloud Container Engine_Autopilot/ User Guide/ Add-ons/ Cloud Native Cluster Monitoring
Updated on 2026-09-28 GMT+08:00

Cloud Native Cluster Monitoring

Introduction

The Cloud Native Cluster Monitoring add-on (kube-prometheus-stack) uses Prometheus-operator and Prometheus to provide easy-to-use, end-to-end Kubernetes cluster monitoring.

This add-on enables monitoring data to be connected to Monitoring Center, so that you can view monitoring data and configure alarms on the console.

Open-source community: https://github.com/prometheus/prometheus

Installing the Add-on

  1. Log in to the CCE console, click the cluster name to go to the cluster console, choose Add-ons in the navigation pane, find the Cloud Native Cluster Monitoring add-on on the right, and click Install.
  2. In the Data Storage Settings area, enable Report Monitoring Data to AOM and select an AOM instance.

    • Report Monitoring Data to AOM: Prometheus data will be reported to AOM. After this function is enabled, you can select the corresponding AOM instance. Basic metrics are free, but custom metrics are billed based on the standard pricing of AOM. For details, see AOM Pricing Details. To interconnect with AOM, you must have certain permissions. Only Huawei Cloud accounts, HUAWEI IDs, or users in the admin user group can perform this operation.
    • Report Monitoring Data to a Third-Party Platform (configurable when Custom Metric Collection is enabled): To report Prometheus data to a third-party monitoring system, you need to enter the address and token of the third-party monitoring system and determine whether to skip certificate authentication.

  3. Configure the add-on specifications as needed.

    • Prometheus HA: The prometheus-lightweight, prometheus-operator, custom-metrics-apiserver, and kube-state-metrics components are deployed in multiple pods in the cluster.
    • Collection Shards: When there is a lot of Prometheus data, you can configure this parameter to spread the data across a specific number of Prometheus instances. This will help with storage and querying. Increasing the number of shards reduces the data volume carried by each shard. This can increase the upper limit of the metric collection throughput but cause more resources to be consumed. By default, CCE automatically determines the number of collection shards based on the cluster scale. If you want to enhance collection performance by increasing the number of shards, carefully assess resource utilization and optimize based on your monitoring needs.
    • Configuration List: You can configure vCPU and memory quotas for each component as needed.

  4. Configure the add-on parameters as needed.

    • Custom Metric Collection: If this function is enabled, metrics collected by Prometheus will be reported through the VPC endpoint of AOM. You need to create VPC endpoints for AOM beforehand. For details, see Creating an AOM Endpoint.
    • Auto Service Discovery (configurable when Custom Metric Collection is enabled): If this function is enabled, application metrics can be automatically collected by annotation. By default, applications in the kube-system and monitoring namespaces are excluded from collection. For details about how to configure automatic collection of annotations, see Configuring Pod Annotations and Configuring Service Annotations.
    • Collection Interval: The value ranges from 10 to 60.

  5. Click Install.

    After installing the Cloud Native Cluster Monitoring add-on, if you need to collect custom metrics, see Monitoring Custom Metrics Using Cloud Native Cluster Monitoring in CCE Autopilot.

Components

All Kubernetes resources created during Cloud Native Cluster Monitoring add-on installation are created in the monitoring namespace.

Table 1 Add-on components

Component

Description

Resource Type

prometheusOperator

(workload name: prometheus-operator)

Deploys and manages the Prometheus Server based on CustomResourceDefinitions (CRDs), and monitors and processes the events related to these CRDs. It is the control center of the entire system.

Deployment

prometheus-lightweight

(workload name: prometheus-lightweight)

A Prometheus Server cluster deployed by the operator based on the Prometheus CRDs that can be regarded as StatefulSets.

StatefulSet

kubeStateMetrics

(workload name: kube-state-metrics)

Converts the Prometheus metric data into a format that can be identified by Kubernetes APIs.

NOTE:

If the components run in multiple pods, only metrics from one of the pods are collected.

Deployment

adapter

(workload name: custom-metrics-apiserver)

Aggregates custom metrics to the native Kubernetes API Server. This is closely related to custom metric HPA. The adapter component needs to be installed only when custom metric HPA is enabled.

Deployment

Providing Resource Metrics Through the Metrics API

Resource metrics of containers, such as CPU and memory usage, can be obtained through the Kubernetes Metrics API. These metrics can be accessed directly by users, for example, using the kubectl top command, or consumed by HPA or CustomedHPA policies to scale workloads based on resource utilization.

The add-on can provide the Kubernetes Metrics API, which is disabled by default. To enable it, create the following APIService object:

apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata:
  labels:
    app: custom-metrics-apiserver
    release: cceaddon-prometheus
  name: v1beta1.metrics.k8s.io
spec:
  group: metrics.k8s.io
  groupPriorityMinimum: 100
  insecureSkipTLSVerify: true
  service:
    name: custom-metrics-apiserver
    namespace: monitoring
    port: 443
  version: v1beta1
  versionPriority: 100

You can save the object as a file named metrics-apiservice.yaml and run the following command:

kubectl create -f metrics-apiservice.yaml

Run the kubectl top pod -n monitoring command. If output similar to the following is displayed, the Metrics API is accessible:

# kubectl top pod -n monitoring
NAME                                                      CPU(cores)   MEMORY(bytes)
......
custom-metrics-apiserver-d4f556ff9-l2j2m                  38m          44Mi
......

To uninstall the add-on, run the following kubectl command and delete the APIService object first. Otherwise, residual APIService resources will cause the metrics-server add-on installation to fail.

kubectl delete APIService v1beta1.metrics.k8s.io

Release History

Table 2 Release history

Add-on Version

Supported Cluster Version

New Feature

Community Version

3.12.18

  • v1.36
  • v1.35
  • v1.34
  • v1.32
  • v1.31

Supported CCE Autopilot clusters v1.36.

2.53.2

3.12.10

  • v1.35
  • v1.34
  • v1.32
  • v1.31
  • Supported CCE Autopilot clusters v1.35.
  • Supported CCE Autopilot clusters v1.34.
  • Supported the collection of custom service metrics.

2.53.2

3.12.2

  • v1.32
  • v1.31
  • v1.28
  • v1.27
  • Supported CCE Autopilot clusters v1.32.
  • Fixed some issues.

2.53.2

3.12.0

  • v1.31
  • v1.28
  • v1.27

Supported CCE Autopilot clusters v1.31.

2.53.2

3.9.6

  • v1.28
  • v1.27

Upgraded the Prometheus version and removed the node-exporter component.

2.53.2

3.9.5

  • v1.28
  • v1.27

Supported custom metrics.

2.37.8

3.9.3

  • v1.28
  • v1.27

Fixed some issues.

2.37.8