Metrics Server

Kubernetes Metrics Server — required for kubectl top, HPA, and Headlamp resource views.

What is Metrics Server?

Metrics Server is a cluster-wide aggregator of resource usage data. It collects CPU and memory metrics from kubelets and exposes them via the Kubernetes Metrics API (metrics.k8s.io).

Metrics Server is not a monitoring solution — it only keeps the most recent data point per pod/node and does not persist history. For historical metrics, VictoriaMetrics is used.

Why It's Needed

Several Kubernetes features depend on the Metrics API:

FeatureNeeds Metrics Server
kubectl top nodesYes
kubectl top podsYes
HPA (Horizontal Pod Autoscaler)Yes
Headlamp resource viewsYes
VPA (Vertical Pod Autoscaler)Yes

Without Metrics Server, kubectl top returns error: Metrics API not available and Headlamp cannot show pod CPU/memory usage.

How It's Deployed

Metrics Server is typically deployed via the Talos cluster bootstrap or as a separate workload. On Talos Linux, the default installation may need the --kubelet-insecure-tls flag because Talos kubelets use self-signed certificates.

# Verify Metrics Server is running
kubectl get deployment metrics-server -n kube-system

# Test it works
kubectl top nodes
kubectl top pods -A

Relationship to Observability Stack

Metrics Server and VictoriaMetrics serve different purposes and are complementary:

Metrics ServerVictoriaMetrics
Data retentionLast value only30 days
Scrape interval60s30s
Use casekubectl top, HPAGrafana, alerting, trending
StorageIn-memoryLonghorn PVC (100 Gi)
ProtocolKubernetes Metrics APIPrometheus remote-write