Member-only story
Kubernetes Metrics-Server & HPA
Overview
The Metrics Server is an integral component of Kubernetes’ autoscaling infrastructure, efficiently gathering container resource metrics from Kubelets.
It exposes these metrics via the Metrics API within the Kubernetes apiserver, facilitating the functionality of both Horizontal Pod Autoscaler (HPA) and Vertical Pod Autoscaler (VPA). Additionally, the Metrics API offers accessibility to tools like kubectl top, streamlining the debugging process for autoscaling configurations.
Caution
The Metrics Server serves a specific purpose: autoscaling. Avoid utilising it to relay metrics to monitoring solutions. Instead, opt to gather metrics directly from the Kubelet’s /metrics/resource
endpoint in scenarios where you need to forward metrics to monitoring solutions.
Advantages
The Metrics Server presents several advantages:
- It offers a unified deployment suitable for the majority of clusters.
- It enables rapid autoscaling by gathering metrics at 15-second intervals.
- It ensures resource efficiency, consuming merely 1 milli-core of CPU and 2 MB of memory per node within a cluster.
- It boasts scalable support, accommodating clusters of up to 5,000…