Skip to content

Commit 9f6b208

Browse files
committed
added docs for high availability
1 parent 61be81f commit 9f6b208

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ are deleted they are no longer visible on the `/metrics` endpoint.
5353
* [Horizontal sharding](#horizontal-sharding)
5454
* [Automated sharding](#automated-sharding)
5555
* [Daemonset sharding for pod metrics](#daemonset-sharding-for-pod-metrics)
56+
* [High Availability](#high-availability)
5657
* [Setup](#setup)
5758
* [Building the Docker container](#building-the-docker-container)
5859
* [Usage](#usage)
@@ -304,6 +305,12 @@ spec:
304305

305306
Other metrics can be sharded via [Horizontal sharding](#horizontal-sharding).
306307

308+
### High Availability
309+
310+
For high availability, run multiple kube-state-metrics replicas with anti-affinity rules to prevent single points of failure. Configure 2 replicas, anti-affinity rules on hostname, rolling update strategy with `maxUnavailable: 1`, and a PodDisruptionBudget with `minAvailable: 1`.
311+
312+
When using multiple replicas, Prometheus will scrape all instances resulting in duplicate metrics with different instance labels. Handle deduplication in queries using `avg without(instance) (metric_name)`. Brief inconsistencies may occur during state transitions but resolve quickly as replicas sync with the API server.
313+
307314
### Setup
308315

309316
Install this project to your `$GOPATH` using `go get`:

0 commit comments

Comments
 (0)