metrics-server 6,745 (v0.9.0, installed in Autoscaling Pods and Nodes for the HPA) scrapes each kubelet every 15 seconds and serves the latest CPU and memory figures through the aggregated metrics.k8s.io API, with no history:
kubectl top pods --sort-by=memory
kubectl get --raw /apis/metrics.k8s.io/v1beta1/namespaces/booknest/pods/postgres-0 \
| jq -c '.containers[] | {name, usage}'Output
NAME CPU(cores) MEMORY(bytes)
postgres-0 95m 78Mi
load2 156m 51Mi
...
web-ccd64df5f-jf87t 31m 6Mi
{"name":"postgres","usage":{"cpu":"94808104n","memory":"79912Ki"}}Two test Pods (load, load2) were sending requests, and the HPA had scaled the API to six replicas. Memory is the working set, which the kubelet uses for evictions.