metrics-server is a component of Alibaba Cloud Container Service for Kubernetes (ACK). It is designed based on the open source monitoring component Metrics Server. metrics-server provides the Metrics API for you to collect resource usage metrics from nodes or pods in order to support Horizontal Pod Autoscaler (HPA).

For more information about the open source monitoring component Metrics Server, see Kubernetes Metrics Server.

Release notes

v0.2.2-b4bf266-aliyun
  • Supports metric collection in an ACK cluster where both nodes that run Windows and nodes that run Linux are deployed.
  • Supports scaling periods of 15 seconds, 20 seconds, 30 seconds, and 60 seconds.
  • Fixes the issue where Horizontal Pod Autoscaler (HPA) is activated during rolling updates of applications.

Troubleshooting

No data is returned after I run the kubectl top pod or kubectl top pod command

Perform the following checks:

Run the kubectl get apiservice command to check whether the API service of metrics-server is working properly. If the API service is abnormal, check whether the pod where metrics-server is deployed can be accessed through port 443 and port 8082 inside the cluster. If you failed to access the pod, restart the pod and try again.

If no error is found after you perform the preceding checks, use the following ticket template to submit a ticket.

Ticket template
  1. Is the API service of metrics-server working properly?

    Yes

  2. Can the pod where metrics-server is deployed be accessed through port 443 and port 8082 inside the cluster?

    Yes

  3. Provide the cluster ID in the ticket.

No data is returned after I run the kubectl top pod or kubectl top pod or kubectl top pod command

Perform the following checks:
  • Check whether all pods on a specified node failed to return data or only some pods failed to return data. If only some pods on the node failed to return data, check whether a timezone shift exists on the target node. You can use Network Time Protocol (NTP) to synchronize the system time
  • Check whether the pod where metrics-server is deployed can connect to port 10255 of the node.

If no error is found after you perform the preceding checks, use the following ticket template to submit a ticket.

Ticket template
  1. Did all pods on a specified node fail to return data?

    Yes

  2. Does a timezone shift exist on the target node?

    No

  3. Can the pod where metrics-server is deployed access the specified node?

    Yes

HPA failed to collect metrics

Perform the following checks:

Run the kubectl top pod pod-id command for the pod where metrics-server is deployed. If the returned data is abnormal, check the pod and node as described in the preceding section.

If no error is found after you perform the preceding checks, use the following ticket template to submit a ticket.

Ticket template
  1. Are anomalies found in the monitoring data?

    No

  2. Run the kubectl describe hpa hpa-name command and provide the metadata in the ticket.

Excessive pods are added by HPA during a rolling update

Perform the following checks:

Check whether the metrics-server component is upgraded to the latest version. If the metrics-server component is upgraded to the latest version, configure the following startup settings in the kube-system namespace for the pod where metrics-server is deployed.
--metric_resolution=15s
--enable-hpa-rolling-update-skipped=true

If no error is found after you perform the preceding checks, use the following ticket template to submit a ticket.

Ticket template
  1. Is the metrics-server component upgraded to the latest version?

    Yes

  2. Are startup settings configured for the pod where metrics-server is deployed?

    Yes

  3. Run the kubectl describe hpa hpa-name command and provide the HPA description in the ticket.