You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+45Lines changed: 45 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,7 @@ are deleted they are no longer visible on the `/metrics` endpoint.
53
53
*[Horizontal sharding](#horizontal-sharding)
54
54
*[Automated sharding](#automated-sharding)
55
55
*[Daemonset sharding for pod metrics](#daemonset-sharding-for-pod-metrics)
56
+
*[High Availability](#high-availability)
56
57
*[Setup](#setup)
57
58
*[Building the Docker container](#building-the-docker-container)
58
59
*[Usage](#usage)
@@ -304,6 +305,50 @@ spec:
304
305
305
306
Other metrics can be sharded via [Horizontal sharding](#horizontal-sharding).
306
307
308
+
### High Availability
309
+
310
+
Kube-state-metrics is a stateless service that reads from the Kubernetes API server. Be aware that multiple replicas increase the load on the Kubernetes API. Therefore, in most cases a single replica is also an option since most users scrape with a 30s interval. If you have the need for a higher scrape frequency or you have other constraints that require multiple replica, you can increase the availablity of kube-state-metrics in the following way:
311
+
312
+
For high availability, run multiple kube-state-metrics replicas to prevent a single point of failure. A common setup uses at least 2 replicas, pod anti-affinity rules to ensure they run on different nodes, and a PodDisruptionBudget (PDB) with `minAvailable: 1` to protect against voluntary disruptions.
If metrics get scraped at the service level via a ServiceMonitor (Prometheus-Operator) or similar, metrics won't need to be deduplicated in a HA setup.
351
+
307
352
### Setup
308
353
309
354
Install this project to your `$GOPATH` using `go get`:
Copy file name to clipboardExpand all lines: README.md.tpl
+45Lines changed: 45 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,7 @@ are deleted they are no longer visible on the `/metrics` endpoint.
53
53
* [Horizontal sharding](#horizontal-sharding)
54
54
* [Automated sharding](#automated-sharding)
55
55
* [Daemonset sharding for pod metrics](#daemonset-sharding-for-pod-metrics)
56
+
* [High Availability](#high-availability)
56
57
* [Setup](#setup)
57
58
* [Building the Docker container](#building-the-docker-container)
58
59
* [Usage](#usage)
@@ -305,6 +306,50 @@ spec:
305
306
306
307
Other metrics can be sharded via [Horizontal sharding](#horizontal-sharding).
307
308
309
+
### High Availability
310
+
311
+
Kube-state-metrics is a stateless service that reads from the Kubernetes API server. Be aware that multiple replicas increase the load on the Kubernetes API. Therefore, in most cases a single replica is also an option since most users scrape with a 30s interval. If you have the need for a higher scrape frequency or you have other constraints that require multiple replica, you can increase the availablity of kube-state-metrics in the following way:
312
+
313
+
For high availability, run multiple kube-state-metrics replicas to prevent a single point of failure. A common setup uses at least 2 replicas, pod anti-affinity rules to ensure they run on different nodes, and a PodDisruptionBudget (PDB) with `minAvailable: 1` to protect against voluntary disruptions.
If metrics get scraped at the service level via a ServiceMonitor (Prometheus-Operator) or similar, metrics won't need to be deduplicated in a HA setup.
352
+
308
353
### Setup
309
354
310
355
Install this project to your `$GOPATH` using `go get`:
0 commit comments