File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -247,19 +247,24 @@ A daemonset kube-state-metrics example:
247
247
```
248
248
apiVersion: apps/v1
249
249
kind: DaemonSet
250
- metadata:
251
- name: kube-state-metrics
252
250
spec:
253
251
template:
254
252
spec:
255
253
containers:
256
- - name: kube-state-metrics
254
+ - image: registry.k8s.io/kube-state-metrics/kube-state-metrics:IMAGE_TAG
255
+ name: kube-state-metrics
257
256
args:
258
- - --resources =pods
257
+ - --resource =pods
259
258
- --nodename=$(NODE_NAME)
259
+ env:
260
+ - name: NODE_NAME
261
+ valueFrom:
262
+ fieldRef:
263
+ apiVersion: v1
264
+ fieldPath: spec.nodeName
260
265
```
261
266
262
- For other metrics, they can sharded via [ Horizontal sharding] ( #horizontal-sharding ) .
267
+ Other metrics can be sharded via [ Horizontal sharding] ( #horizontal-sharding ) .
263
268
264
269
### Setup
265
270
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ func (n *NodeNameType) GetNodeNameFieldSelector() string {
112
112
if string (* n ) != "" {
113
113
return fields .OneTermEqualSelector ("spec.nodeName" , string (* n )).String ()
114
114
}
115
- return fields . Nothing (). String ()
115
+ return EmptyFieldSelector ()
116
116
}
117
117
118
118
// EmptyFieldSelector returns an empty field selector.
You can’t perform that action at this time.
0 commit comments