Understand Metrics Exposed by Metrics Server
masterMetrics Server collects resource usage metrics specifically for autoscaling. It exposes:
- CPU: Reported as the average core usage in CPU units (e.g., 1 vCPU/Core or 1 hyperthread). It is derived from a rate over a cumulative CPU counter provided by the kernel. The time window used for this calculation is available in the
windowfield of the Metrics API. - Memory: Reported as the working set at the instant of collection, measured in bytes. This includes all anonymous (non-file-backed) memory and typically some cached (file-backed) memory.
Metrics use standard Kubernetes Metric System prefixes (e.g., n for $10^{-9}$ and Ki for $2^{10}$).
Note: Metrics Server does not calculate these values; it aggregates values exposed by Kubelet. It does not provide utilization percentages (e.g., % CPU used); those are calculated client-side by tools like kubectl top or HPA.