kube-state-metrics and Metrics Server are the two components people confuse most often in Kubernetes observability — both sit near the API server, both expose metrics, and both are frequently installed together. But they answer completely different questions: Metrics Server answers "how much CPU/memory is this Pod using right now?" while kube-state-metrics answers "what is the state of this object — how many replicas does it want, how many does it have, what phase is it in?"

Definitions, Side by Side

kube-state-metricsMetrics Server
AnswersWhat state is this object in?How many resources is this Pod/Node using right now?
Data sourceKubernetes API server object watcheskubelet /stats/summary (via cAdvisor)
API exposedPrometheus text format on /metricsmetrics.k8s.io aggregated API
StorageNone — a snapshot regenerated on every scrapeLatest sample only, held in memory (~1–2 min TTL)
PowersPrometheus dashboards, alerting, SLOskubectl top, HPA, VPA
Historical dataYes, once scraped into PrometheusNo — by design
Example metricskube_deployment_status_replicas_available, kube_pod_status_phasecontainer_cpu_usage_seconds_total-derived usage, node.cpu.usage

Sample Output From Each

kube-state-metrics exposes plain Prometheus text metrics for object state:

kube_deployment_status_replicas_available{deployment="checkout",namespace="prod"} 3
kube_deployment_spec_replicas{deployment="checkout",namespace="prod"} 4
kube_pod_status_phase{pod="checkout-7f9c-abc12",namespace="prod",phase="Running"} 1

Metrics Server exposes live resource usage through the Kubernetes API — you don't scrape it with Prometheus directly, you query it with kubectl top or let the HPA controller read it:

$ kubectl top pod checkout-7f9c-abc12 -n prod
NAME                    CPU(cores)   MEMORY(bytes)
checkout-7f9c-abc12     42m          186Mi
ℹ️
Notice the difference in shape: KSM tells you 3 of 4 desired replicas are available — a fact about the Deployment object. Metrics Server tells you this one Pod is using 42m CPU right now — a live resource sample. Neither can produce the other's output.

Where kubectl top and Kubelet Metrics Fit In

A common source of confusion: kubectl top and "kubelet metrics" are not the same thing as kube-state-metrics, and searching for "kubelet metrics" or "kubectl metrics" usually means you actually want Metrics Server, not KSM.

Decision Matrix: Which One Do You Need?

Use caseUse
Horizontal Pod Autoscaler (CPU/memory-based)Metrics Server
kubectl top node / kubectl top podMetrics Server
Alert when Deployment has fewer available replicas than desiredkube-state-metrics
Dashboard of Pod restart counts over the last 30 dayskube-state-metrics (Prometheus stores the history)
Alert on Node NotReady conditionkube-state-metrics
Custom HPA on a business metric (e.g. queue depth)Neither — use the Prometheus Adapter or KEDA, fed by your own exporter
Real-time CPU/memory usage per containerMetrics Server (or cAdvisor/Node Exporter for more granularity)

In practice, almost every production cluster runs both, since they don't compete for resources or conflict — Metrics Server is typically pre-installed by managed Kubernetes providers (EKS, GKE, AKS) for autoscaling, while kube-state-metrics is added on top for Prometheus-based monitoring. See the Helm installation guide to add kube-state-metrics alongside an existing Metrics Server deployment.

FAQ

Can kube-state-metrics replace Metrics Server?

No. The HPA and kubectl top both read from the metrics.k8s.io API, which only Metrics Server implements. kube-state-metrics doesn't serve that API and can't power autoscaling by itself.

Can Metrics Server replace kube-state-metrics?

No. Metrics Server discards history and has no concept of Deployment replica counts, Pod phase, Node conditions, or any other object-state field — it only knows current CPU/memory usage.

Does kube-state-metrics support autoscaling?

Indirectly — KSM exposes kube_horizontalpodautoscaler_* metrics so you can monitor and alert on HPA behavior in Prometheus, but the HPA controller itself still relies on Metrics Server (or the Prometheus Adapter for custom metrics) to make scaling decisions.