liveBook · Manning

Metrics-server

As explained in Acing the Certified Kubernetes Administrator Exam, Second Edition

Metrics Server is a Kubernetes cluster component that collects resource-usage metrics from nodes and containers and exposes them through the resource metrics API.

Metrics Server collects CPU and memory usage from Kubernetes nodes and containers, making resource metrics available for operational inspection and autoscaling. section 5.1.5 section 8.2.2

Use Metrics Server to verify live utilization and support these administrator tasks:

  • Run kubectl top pod to inspect pod CPU and memory consumption. section 5.1.5
  • Run kubectl top no to inspect node utilization, including CPU and memory percentages. section 8.2.2
  • Provide metrics that let a HorizontalPodAutoscaler replace an <unknown> target with an observed value. section 5.1.5

Install and verify Metrics Server

Apply the v0.8.0 components manifest, then patch the deployment with --kubelet-insecure-tls when required by a local kind cluster. After waiting up to 60 seconds, run kubectl top pod or kubectl top no. A working setup produces live readings such as 0m CPU for nginx pods or 265m CPU and 972Mi memory for a node. section 5.1.5 section 8.2.2

root@kind-control-plane:/# kubectl top pod | egrep "CPU|nginx"
NAME                      CPU(cores)   MEMORY(bytes)   
nginx-5c799c6d5f-4lkr9    0m           3Mi             
nginx-5c799c6d5f-8w494    0m           2Mi

Inspect representative kubectl top pod output showing CPU and memory readings after Metrics Server becomes available. section 5.1.5

How Acing the Certified Kubernetes Administrator Exam, Second Edition covers it

How deep it goes
Reaches installation, TLS patching, verification, and HPA effects, but defers detailed installation during exam-focused troubleshooting.
Examples
Uses kubectl top pod, kubectl top no, an nginx HPA, and representative CPU and memory output.
What it assumes
Assumes basic kubectl and Kubernetes workload knowledge while teaching installation, verification, and common local-cluster TLS adjustment.
What you can do after
Operate/configure Metrics Server, verify kubectl top output, and diagnose missing HPA targets or node utilization data.
How it connects
Connects resource metrics with HorizontalPodAutoscaler, kubectl top, kubelet, node conditions, and resource requests.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Certified Kubernetes Administrator Exam, Second Edition. The section links point to the parts of the book it draws on.