Skip to content

Commit

Permalink
update readme ,track metrics for unassigned pods
Browse files Browse the repository at this point in the history
Signed-off-by: mickeyzzc <mickey_zzc@163.com>
  • Loading branch information
mickeyzzc committed Nov 23, 2023
1 parent d1f04c2 commit ad0e06c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ The downside of using an auto-sharded setup comes from the rollout strategy supp

For pod metrics, they can be sharded per node with the following flag:

* `--node`
* `--node=$(NODE_NAME)`

Each kube-state-metrics pod uses FieldSelector (spec.nodeName) to watch/list pod metrics only on the same node.

Expand All @@ -276,6 +276,21 @@ spec:
fieldPath: spec.nodeName
```

To track metrics for unassigned pods, you need to add an additional deployment and set `--node=""`, as shown in the following example:
```
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
containers:
- image: registry.k8s.io/kube-state-metrics/kube-state-metrics:IMAGE_TAG
name: kube-state-metrics
args:
- --resources=pods
- --node=""
```

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

### Setup
Expand Down

0 comments on commit ad0e06c

Please sign in to comment.