Updated on 2024-04-15 GMT+08:00

Installing a Metric Collection Add-on

Before creating a FederatedHPA, you need to install the add-on that supports metrics APIs for a cluster to collect workload metrics. If you have installed the add-on, skip this step.

Selecting an Add-on

UCS provides two types of add-ons: Kubernetes Metrics Server and kube-prometheus-stack. The add-ons apply to different cluster and metric types. For details about how to select an add-on, see Table 1.

Table 1 Add-ons that provide metrics APIs

Applicable Cluster Type

Supported Metric Type

Add-on

Precautions

Huawei Cloud clusters

System metrics

Install Kubernetes Metrics Server or kube-prometheus-stack.

After installing kube-prometheus-stack, you need to register it as a service that provides the metrics API. For details, see Providing Resource Metrics Through the Metrics API.

Custom metrics

Install kube-prometheus-stack.

  • Before installing this add-on, check your Huawei Cloud cluster version. If the version is earlier than v1.19, upgrade the cluster version first.
  • When installing this add-on, you must select the server mode. In this mode, you can customize metrics.
  • After installing this add-on, aggregate custom metrics to the Kubernetes API server. For details, see Aggregating Custom Metrics to the Kubernetes API Server.

Non-Huawei Cloud clusters

System metrics

Install Kubernetes Metrics Server.

For details, see Installing an Add-on.

Custom metrics

No add-on available.

To collect custom metrics of a non-Huawei Cloud cluster, you need to install Prometheus Adapter and configure a custom metric collection rule. Then create a FederatedHPA.

Installing an Add-on

After selecting an applicable add-on, install it for the cluster by referring to the precautions in Table 1 and related documents.

Install the metric collection add-on for all clusters in a federation for which a scaling policy needs to be created. Otherwise, metric collection will be abnormal and the scaling policy will become invalid.