FeaturesMetricsArchitectureDocsBlogFAQ
GitHub Get Started
v2.19 · Open Source · Kubernetes SIG Instrumentation

kube-state-metrics:
Kubernetes Monitoring
Made Simple

kube-state-metrics is the standard Kubernetes state-metrics exporter for Prometheus. Install it via Helm and expose 200+ object metrics with zero configuration drift and sub-second polling.

200+
Metrics Exposed
6.2k+
Stars on GitHub
10+
Years Battle-Tested
0
External Dependencies
bash — kube-state-metrics
$kubectl apply -f https://github.com/kubernetes/kube-state-metrics/releases/latest
✓ serviceaccount/kube-state-metrics created
✓ deployment.apps/kube-state-metrics created
✓ service/kube-state-metrics created
# Query your first metric
$curl http://localhost:8080/metrics | grep kube_pod_info
kube_pod_info{namespace="default",pod="nginx-6d4cf56db6-x8vkl",node="worker-1"} 1
kube_pod_info{namespace="kube-system",pod="coredns-5d78c9869d-4t2n8",node="master-1"} 1
# 200+ metrics now available at :8080/metrics
Integrates with
Prometheus
Grafana
Helm
Datadog
Prometheus Operator
Kubernetes

Built for Production
at any scale

From single-node dev clusters to 10,000-node enterprise fleets, KSM delivers accurate, consistent Kubernetes state data to your entire observability stack.

CNCF Project Prometheus Native OpenMetrics

Sub-Second Polling

State changes reflected in under 100ms via Kubernetes informers. No polling lag, no stale data — your alerts fire when the issue actually occurs.

🔒

RBAC-First Security

Principle of least privilege built in. Fine-grained RBAC, shard-level access control, and TLS encryption on all endpoints out of the box.

🔀

Horizontal Sharding

Scale to 10,000+ nodes by distributing object-type processing across multiple KSM replicas. Linear scalability with zero configuration complexity.

🏷️

Custom Resource Support

Expose metrics from your own CRDs with a single configuration block. No code changes, no recompilation — just YAML.

📦

OpenMetrics & OTLP

Native OpenMetrics v2 support and OpenTelemetry exporter compatibility. Works with every modern observability backend.

🌐

Multi-Cluster Ready

Label all metrics with cluster identifiers for seamless multi-cluster federation. One dashboard to rule them all.

🎛️

Allow & Deny Lists

Reduce cardinality and scrape overhead by filtering precisely which metrics and labels are exposed. Slash storage costs by up to 60%.

Live Cluster Insights

Sample metrics from a production cluster. KSM makes this data instantly queryable with Prometheus.

Full Reference →
47
kube_pod_status_phase{phase="Running"}
Running Pods
12
kube_deployment_status_replicas_available
Deployments Healthy
6
kube_node_status_condition{condition="Ready"}
Nodes Ready
98.7%
kube_deployment_status_replicas_ready / spec
Deployment Availability

Architecture Overview

KSM listens to Kubernetes API events via informers, transforms object state into Prometheus-compatible metrics, and serves them on a high-performance HTTP endpoint.

Kubernetes API
Objects & Events
📡
KubeStateMetrics
Informer Cache · Metrics Store
🔥
Prometheus
Scrape · TSDB · Alerts
📈
Grafana
Dashboards · Explore
🔔
Alert Manager
PagerDuty · Slack · OpsGenie
List/Watch Informers
<100ms State Lag
Atomic Metric Store
Concurrent HTTP Scrapes
Label Allow/Deny
Horizontal Sharding

Up and running
in 60 seconds

Three installation methods — pick what fits your workflow. All produce the same powerful KSM deployment.

Helm Chart
Recommended for production
📦
kubectl apply
Direct manifest deployment
🎛️
Kustomize
Overlay-based configuration
helm.sh
# Add the prometheus-community chart repo helm repo add prometheus-community \ https://prometheus-community.github.io/helm-charts # Update chart index helm repo update # Install with custom values helm install kube-state-metrics \ prometheus-community/kube-state-metrics \ --namespace monitoring \ --create-namespace \ --set replicaCount=2 \ --set autosharding.enabled=true
kubectl.sh
# Apply the latest release manifests directly kubectl apply -f \ https://github.com/kubernetes/kube-state-metrics/ releases/latest/download/kube-state-metrics.yaml # Verify the deployment kubectl rollout status \ deployment/kube-state-metrics -n kube-system # Port-forward to test locally kubectl port-forward svc/kube-state-metrics \ 8080:8080 -n kube-system
kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization namespace: monitoring resources: - https://github.com/kubernetes/kube-state-metrics /examples/standard?ref=main patches: - patch: |- apiVersion: apps/v1 kind: Deployment metadata: name: kube-state-metrics spec: replicas: 2

Why choose KSM

See how KubeStateMetrics stacks up against alternatives for Kubernetes observability.

Feature KubeStateMetrics cAdvisor Metrics Server Custom Scripts
Object State Metrics Full Coverage ~ Manual
Resource Usage Metrics ~ Via cAdvisor Native ~ Basic ~ Manual
Prometheus Integration Native ~ Custom
Horizontal Sharding Built-in
Custom Resource Support CRD Config ~ Manual
Label Allow/Deny Lists Full Control ~ Manual
RBAC Security Fine-grained ~ Basic ~ Custom
Maintenance Overhead Zero config Low Low High
Alert Rules Library 50+ built-in ~ Basic
Grafana Dashboard Included

Read the full kube-state-metrics vs Metrics Server comparison →

How teams actually use kube-state-metrics

📊
Cluster-wide SLO dashboards

Teams commonly build Grafana dashboards on top of kube_deployment_status_replicas_available and kube_pod_status_phase to track availability SLOs across every namespace from a single pane of glass.

🔧
Replacing hand-rolled exporters

Because kube-state-metrics already covers Deployments, StatefulSets, Jobs, HPAs, and PVCs out of the box, most teams retire custom scripts that polled the Kubernetes API directly for the same data.

🧩
Custom resource observability

The CustomResourceStateMetrics config lets operators expose CRD status fields as first-class Prometheus metrics without writing a dedicated exporter for every custom controller.

Your cluster's state is a
metric away

Deploy KubeStateMetrics in 60 seconds and transform your Kubernetes observability forever.

v2.19.1 Latest Release Go 1.26 Built With Apache 2.0 License