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:
247247```
248248apiVersion: apps/v1
249249kind: DaemonSet
250- metadata:
251- name: kube-state-metrics
252250spec:
253251 template:
254252 spec:
255253 containers:
256- - name: kube-state-metrics
254+ - image: registry.k8s.io/kube-state-metrics/kube-state-metrics:IMAGE_TAG
255+ name: kube-state-metrics
257256 args:
258- - --resources =pods
257+ - --resource =pods
259258 - --nodename=$(NODE_NAME)
259+ env:
260+ - name: NODE_NAME
261+ valueFrom:
262+ fieldRef:
263+ apiVersion: v1
264+ fieldPath: spec.nodeName
260265```
261266
262- For other metrics, they can sharded via [ Horizontal sharding] ( #horizontal-sharding ) .
267+ Other metrics can be sharded via [ Horizontal sharding] ( #horizontal-sharding ) .
263268
264269### Setup
265270
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ func (n *NodeNameType) GetNodeNameFieldSelector() string {
112112 if string (* n ) != "" {
113113 return fields .OneTermEqualSelector ("spec.nodeName" , string (* n )).String ()
114114 }
115- return fields . Nothing (). String ()
115+ return EmptyFieldSelector ()
116116}
117117
118118// EmptyFieldSelector returns an empty field selector.
You can’t perform that action at this time.
0 commit comments