Course contentsShow
← Cloud and Infrastructure
Lesson 1445 of 2,98929. Kubernetes ObservabilityFree lesson

Metrics Server Architecture

Understanding the Metrics Server component, its role in collecting resource metrics, and how it integrates with the Kubernetes API.

Metrics Server Architecture

What you'll learn: How the Metrics Server collects and serves resource usage data within your Kubernetes cluster.

What Is Metrics Server?

The Metrics Server is a lightweight, cluster-wide aggregator of resource usage metrics. Think of it as a specialized monitoring component that focuses exclusively on current CPU and memory consumption for nodes and pods—nothing historical, just real-time snapshots.

Unlike full-featured monitoring systems, Metrics Server serves a specific purpose: it provides the basic metrics needed for Kubernetes' autoscaling features (like the Horizontal Pod Autoscaler) and for kubectl top commands.

How It Works

Metrics Server collects data by querying each node's kubelet through its Summary API (an endpoint on every kubelet that exposes resource usage). It then:

  1. Scrapes metrics from kubelets every 60 seconds (default)
  2. Aggregates this data in-memory (no persistent storage)
  3. Exposes these metrics through the Kubernetes API Server via the Metrics API

The Metrics API is a standard Kubernetes API extension (metrics.k8s.io/v1beta1) that other components can query. When you run kubectl top nodes, you're actually hitting this API.

Integration Architecture

Metrics Server registers itself with the API Server using the API Aggregation Layer. This allows it to appear as a native part of the Kubernetes API, even though it runs as a separate deployment in your cluster (typically in the kube-system namespace).

The data flows one way: kubelet → Metrics Server → API Server → consumers (HPA, kubectl, etc.).

Key Takeaway: Metrics Server is a focused component that bridges node-level resource data with the Kubernetes API, enabling autoscaling and basic observability without the overhead of a full monitoring stack.