# kube-state-metrics

kube-state-metrics is a service that listens to the Kubernetes API server and generates metrics about the state of cluster objects such as deployments, nodes, and pods for use by monitoring systems. It is open source and self-hosted, installable on Docker Hub and Kubernetes (Helm).

Canonical page: https://ourlocalhost.com/app/4664/kube-state-metrics

## Description

Kube-state-metrics is a service that listens to the Kubernetes API server and generates metrics about the state of cluster objects such as deployments, nodes, and pods for use by monitoring systems.

## Platform availability

Available on 1 of 10 platforms: Helm.

## Health score

76/100 (Good), based on 5 of 5 factors.
- Maintained: 100 (last commit 1 day ago)
- Popular: 76 (6,237 GitHub stars)
- Easy to install: 10 (1 install platform)
- Light to run: 100 (250 MB minimum RAM)
- Security check: 74 (no serious findings, 3 minor, CI, tests, OpenSSF Scorecard 6.1/10)

## Links

- Docker Hub: https://hub.docker.com/r/bitnamicharts/kube-state-metrics
- Kubernetes (Helm): https://artifacthub.io/packages/helm/prometheus-community/kube-state-metrics
- GitHub: https://github.com/kubernetes/kube-state-metrics
- Official website: https://kubernetes.io/docs/concepts/cluster-administration/kube-state-metrics/

## Common questions

### Why can kube-state-metrics show values that differ from kubectl output?

kube-state-metrics exposes raw data unmodified from the Kubernetes API. kubectl applies display heuristics, so the two can present different values.

### How should an external Prometheus instance collect kube-state-metrics?

Prometheus or another scraper should collect from the kube-state-metrics HTTP endpoint. That endpoint exposes metrics generated from the state of individual Kubernetes objects.

### Do multiple kube-state-metrics replicas create duplicate metrics?

Yes, the source reports that setting replicas to 2 produces double the metrics. It asks whether two replicas can provide HA without duplicating the metric set.

### What failure modes should I check when kube-state-metrics is misbehaving?

Check for CrashLoopBackOff, OOMKilled, high CPU usage, metrics not appearing, permission errors, and pods not starting after an upgrade.

### Can kube-state-metrics pod start/stop metrics disappear with Prometheus remote write?

The source describes missing kube-state-metrics pod start/stop data when using Prometheus remote write. This can affect attempts to track pod uptime.

## Alternatives

- Consul Lambda Registrator: Consul Lambda Registrator is a containerized AWS Lambda function that registers and deregisters AWS Lambda functions in Consul, helping ope…
- Heroku: Heroku is a platform as a service (PaaS) that enables developers to build, run, and operate applications entirely in the cloud.
- OpenShift: Red Hat OpenShift is a trusted, comprehensive, and consistent platform to develop, modernize, and deploy applications at scale, including t…
- Rancher: A container management platform built for organizations that deploy containers in production.
- Rancher Desktop: Rancher Desktop is an open-source desktop application for Mac, Windows and Linux.
- VMPal
- Vagrant: Create and manage virtualized development environments.
- isaiah: Self-hostable clone of lazydocker for the web.
- openfaas: OpenFaaS is a lightweight serverless platform for deploying event-driven functions and microservices to Kubernetes or a standalone host wit…
- radius: Radius is a cloud-native application platform that enables developers and the platform engineers that support them to collaborate on delive…
- virt-manager: Virt-Manager is a desktop graphical interface for virtualization administrators to create, configure, monitor, and access libvirt virtual m…

---
Source: Our Local Host (https://ourlocalhost.com/app/4664/kube-state-metrics), the self-hosted and open-source app directory.
