alibaba-cloud-metrics-adapter allows you to use cloud metrics to horizontally scale pods with the Horizontal Pod Autoscaler (HPA). This topic describes how to deploy alibaba-cloud-metrics-adapter in a registered Kubernetes cluster by using Container Service for Kubernetes (ACK).
Prerequisites
-
An ACK One registered cluster is created, and the self-managed Kubernetes cluster in your data center is connected to the ACK One registered cluster. For more information, see Create an ACK One registered cluster.
-
Obtain the kubeconfig file of the cluster and connect to the registered cluster by using kubectl.
Background information
In Kubernetes, monitoring data is used not only to display metrics but also by the HPA to make scaling decisions. To meet monitoring requirements at different levels, Kubernetes defines the following three categories of metrics:
| Metric type | Collected by | Used for |
|---|---|---|
| Resource metrics | metrics-server | Monitors built-in Kubernetes objects such as pods, nodes, and namespaces |
| Custom metrics | Application Real-Time Monitoring Service (ARMS) Prometheus | User-defined metrics that are collected by Prometheus and consumed by the HPA |
| External metrics | alibaba-cloud-metrics-adapter (via the external metrics API) | Monitors external metrics in cloud scenarios, such as the queries per second (QPS) of an Ingress that is obtained from a cloud provider and used as a scaling metric |
Deploy alibaba-cloud-metrics-adapter
Log on to the Container Service Management Console.
In the left navigation pane, choose .
-
On the Marketplace page, click the App Catalog tab, and then search for and click ack-alibaba-cloud-metrics-adapter.
-
On the ack-alibaba-cloud-metrics-adapter page, click Quick Deployment.
-
In the Create panel, select a cluster and a namespace, and then click Next.
The Namespace and Release Name parameters use the default values and do not require configuration.
-
On the Parameters page, set the following parameters, and then click OK.
Parameter Description AccessKeyId The AccessKey ID of your Alibaba Cloud account AccessKeySecret The AccessKey secret of your Alibaba Cloud account Region The region where your cluster is deployed, for example, cn-qingdaoorap-southeast-1If an Express Connect circuit is deployed between your cluster and the virtual private cloud (VPC) where the cluster resides, the Express Connect circuit is used automatically.