FeaturesMetricsArchitectureDocsBlogFAQ
GitHub Get Started
v2.13 · Production Ready · CNCF Sandbox

kube-state-metrics:
Kubernetes Monitoring
Made Simple

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

200+
Metrics Exposed
99.9%
Uptime SLA
50k+
Stars on GitHub
500M+
Docker Pulls
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
Trusted by engineering teams at
Stripe
Spotify
Shopify
Airbnb
Uber
GitHub
Netflix
Apple
Microsoft

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

Trusted by 10,000+ teams

"KubeStateMetrics is the backbone of our entire Kubernetes observability stack. We run 200+ clusters and rely on it to alert us before issues affect customers. Nothing else comes close."

SR
Samantha R.
Principal SRE · Stripe

"We replaced a 3,000-line custom metrics collection framework with KSM + 20 lines of Helm values. The horizontal sharding feature alone saved us from a complete re-architecture."

MK
Marcus K.
Head of Platform Eng · Zalando

"Migrating to KSM's custom resource support let us expose our operator's state as first-class Prometheus metrics. Our on-call load dropped 40% in the first month."

AL
Aiko L.
Staff Engineer · Mercari

Your cluster's state is a
metric away

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

v2.13.0 Latest Release Go 1.22 Built With Apache 2.0 License