Skip to content

Commit 8f5b735

Browse files
author
Sam Ghods
committed
Update README.md
1 parent 3ee2b63 commit 8f5b735

1 file changed

Lines changed: 26 additions & 15 deletions

File tree

README.md

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,45 @@
11
# Overview
22

3-
kube-state-metrics generates metrics about the state of the object inside of a
4-
Kubernetes cluster. It is not focused on the health of the Kubernetes
5-
components individually, but rather on the health of the various objects
6-
inside, such as deployments, nodes and pods.
3+
kube-state-metrics is a simple service that listens to the Kubernetes API
4+
server and generates metrics about the state of the objects. (See examples in
5+
the Metrics section below.) It is not focused on the health of the individual
6+
Kubernetes components, but rather on the health of the various objects inside,
7+
such as deployments, nodes and pods.
8+
9+
The metrics are exported through the [Prometheus golang
10+
client](https://github.com/prometheus/client_golang) on the HTTP endpoint `/metrics` on
11+
the listening port (default 80). They are served either as plaintext or
12+
protobuf depending on the `Accept` header. They are designed to be consumed
13+
either by Prometheus itself or by a scraper that is compatible with scraping
14+
a Prometheus client endpoint. You can also open `/metrics` in a browser to see
15+
the raw metrics.
716

817
*Requires Kubernetes 1.2+*
918

10-
# Usage
11-
12-
Simply build and run kube-state-metrics inside a Kubernetes pod which has a
13-
service account token that has read-only access to the Kubernetes cluster.
14-
1519
## Metrics
1620

1721
There are many more metrics we could report, but this first pass is focused on
18-
those that could result in actionable alerts. Please contribute PR's for
22+
those that could be used for actionable alerts. Please contribute PR's for
1923
additional metrics!
2024

2125
### WARNING: THESE METRIC/TAG NAMES ARE UNSTABLE AND MAY CHANGE IN A FUTURE RELEASE.
2226

23-
* nodes ready=<true|false>
24-
* deployment_replicas name=<deployment-name> namespace=<deployment-namespace>
25-
* deployment_replicas_available name=<deployment-name> namespace=<deployment-namespace>
26-
* container_restarts name=<container-name> namespace=<pod-namespace> pod_name=<pod-name>
27+
| Metric name | Labels/tags |
28+
| ------------- | ------------- |
29+
| nodes | ready=<true|false> |
30+
| deployment_replicas | name=<deployment-name> namespace=<deployment-namespace> |
31+
| deployment_replicas_available | name=<deployment-name> namespace=<deployment-namespace> |
32+
| container_restarts | name=<container-name> namespace=<pod-namespace> pod_name=<pod-name> |
33+
34+
# Usage
35+
36+
Simply build and run kube-state-metrics inside a Kubernetes pod which has a
37+
service account token that has read-only access to the Kubernetes cluster.
2738

2839
# Development
2940

3041
When developing, test a metric dump against your local Kubernetes cluster by running:
3142

3243
```
33-
go run main.go --apiserver=<APISERVER-HERE> --in-cluster=false --port=<APISERVER-PORT> --dry-run
44+
go run main.go --apiserver=<APISERVER-HERE> --in-cluster=false --port=<APISERVER-PORT> --dry-run
3445
```

0 commit comments

Comments
 (0)