Skip to content

Commit ad0e06c

Browse files
committed
update readme ,track metrics for unassigned pods
Signed-off-by: mickeyzzc <[email protected]>
1 parent d1f04c2 commit ad0e06c

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

README.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ The downside of using an auto-sharded setup comes from the rollout strategy supp
250250

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

253-
* `--node`
253+
* `--node=$(NODE_NAME)`
254254

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

@@ -276,6 +276,21 @@ spec:
276276
fieldPath: spec.nodeName
277277
```
278278

279+
To track metrics for unassigned pods, you need to add an additional deployment and set `--node=""`, as shown in the following example:
280+
```
281+
apiVersion: apps/v1
282+
kind: Deployment
283+
spec:
284+
template:
285+
spec:
286+
containers:
287+
- image: registry.k8s.io/kube-state-metrics/kube-state-metrics:IMAGE_TAG
288+
name: kube-state-metrics
289+
args:
290+
- --resources=pods
291+
- --node=""
292+
```
293+
279294
Other metrics can be sharded via [Horizontal sharding](#horizontal-sharding).
280295

281296
### Setup

0 commit comments

Comments
 (0)