Skip to content

Commit eda1984

Browse files
Rename --enable-unscheduled-pods-fetching to --track-unscheduled-pods
1 parent 19a0544 commit eda1984

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ spec:
282282
fieldPath: spec.nodeName
283283
```
284284

285-
To track metrics for unassigned pods, you need to add an additional deployment and set `--enable-unscheduled-pods-fetching`, as shown in the following example:
285+
To track metrics for unassigned pods, you need to add an additional deployment and set `--track-unscheduled-pods`, as shown in the following example:
286286

287287
```
288288
apiVersion: apps/v1
@@ -295,7 +295,7 @@ spec:
295295
name: kube-state-metrics
296296
args:
297297
- --resources=pods
298-
- --enable-unscheduled-pods-fetching
298+
- --track-unscheduled-pods
299299
```
300300

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

README.md.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ spec:
283283
fieldPath: spec.nodeName
284284
```
285285

286-
To track metrics for unassigned pods, you need to add an additional deployment and set `--enable-unscheduled-pods-fetching`, as shown in the following example:
286+
To track metrics for unassigned pods, you need to add an additional deployment and set `--track-unscheduled-pods`, as shown in the following example:
287287

288288
```
289289
apiVersion: apps/v1
@@ -296,7 +296,7 @@ spec:
296296
name: kube-state-metrics
297297
args:
298298
- --resources=pods
299-
- --enable-unscheduled-pods-fetching
299+
- --track-unscheduled-pods
300300
```
301301

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

docs/developer/cli-arguments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Flags:
4848
--custom-resource-state-config-file string Path to a Custom Resource State Metrics config file (experimental)
4949
--custom-resource-state-only Only provide Custom Resource State metrics (experimental)
5050
--enable-gzip-encoding Gzip responses when requested by clients via 'Accept-Encoding: gzip' header.
51-
--enable-unscheduled-pods-fetching This configuration is used in conjunction with node configuration. When this configuration is true, node configuration is empty and the metric of unscheduled pods is fetched from the Kubernetes API Server. This is experimental.
51+
--track-unscheduled-pods This configuration is used in conjunction with node configuration. When this configuration is true, node configuration is empty and the metric of unscheduled pods is fetched from the Kubernetes API Server. This is experimental.
5252
-h, --help Print Help text
5353
--host string Host to expose metrics on. (default "::")
5454
--kubeconfig string Absolute path to the kubeconfig file

examples/daemonsetsharding/deployment-no-node-pods.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ spec:
2323
containers:
2424
- args:
2525
- --resources=pods
26-
- --enable-unscheduled-pods-fetching
26+
- --track-unscheduled-pods
2727
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.13.0
2828
livenessProbe:
2929
httpGet:

jsonnet/kube-state-metrics/kube-state-metrics.libsonnet

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@
377377
local c = ksm.deployment.spec.template.spec.containers[0] {
378378
args: [
379379
'--resources=pods',
380-
'--enable-unscheduled-pods-fetching',
380+
'--track-unscheduled-pods',
381381
],
382382
name: shardksmname,
383383
};
@@ -410,7 +410,7 @@
410410
local c = ksm.deployment.spec.template.spec.containers[0] {
411411
args: [
412412
'--resources=pods',
413-
'--enable-unscheduled-pods-fetching',
413+
'--track-unscheduled-pods',
414414
],
415415
};
416416
local shardksmname = ksm.name + "-no-node-pods";

pkg/app/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func RunKubeStateMetrics(ctx context.Context, opts *options.Options) error {
224224

225225
namespaces := opts.Namespaces.GetNamespaces()
226226
nsFieldSelector := namespaces.GetExcludeNSFieldSelector(opts.NamespacesDenylist)
227-
nodeFieldSelector := opts.Node.GetNodeFieldSelector(opts.EnableUnscheduledPodsFetching)
227+
nodeFieldSelector := opts.Node.GetNodeFieldSelector(opts.TrackUnscheduledPods)
228228
merged, err := storeBuilder.MergeFieldSelectors([]string{nsFieldSelector, nodeFieldSelector})
229229
if err != nil {
230230
return err

pkg/options/options.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ type Options struct {
5959
Namespaces NamespaceList `yaml:"namespaces"`
6060
NamespacesDenylist NamespaceList `yaml:"namespaces_denylist"`
6161
Node NodeType `yaml:"node"`
62-
EnableUnscheduledPodsFetching bool `yaml:"enable_unscheduled_pods_fetching"`
62+
TrackUnscheduledPods bool `yaml:"track_unscheduled_pods"`
6363
Pod string `yaml:"pod"`
6464
Port int `yaml:"port"`
6565
Resources ResourceSet `yaml:"resources"`
@@ -138,7 +138,7 @@ func (o *Options) AddFlags(cmd *cobra.Command) {
138138

139139
o.cmd.Flags().BoolVar(&o.CustomResourcesOnly, "custom-resource-state-only", false, "Only provide Custom Resource State metrics (experimental)")
140140
o.cmd.Flags().BoolVar(&o.EnableGZIPEncoding, "enable-gzip-encoding", false, "Gzip responses when requested by clients via 'Accept-Encoding: gzip' header.")
141-
o.cmd.Flags().BoolVar(&o.EnableUnscheduledPodsFetching, "enable-unscheduled-pods-fetching", false, "This configuration is used in conjunction with node configuration. When this configuration is true, node configuration is empty and the metric of unscheduled pods is fetched from the Kubernetes API Server. This is experimental.")
141+
o.cmd.Flags().BoolVar(&o.TrackUnscheduledPods, "track-unscheduled-pods", false, "This configuration is used in conjunction with node configuration. When this configuration is true, node configuration is empty and the metric of unscheduled pods is fetched from the Kubernetes API Server. This is experimental.")
142142
o.cmd.Flags().BoolVarP(&o.Help, "help", "h", false, "Print Help text")
143143
o.cmd.Flags().BoolVarP(&o.UseAPIServerCache, "use-apiserver-cache", "", false, "Sets resourceVersion=0 for ListWatch requests, using cached resources from the apiserver instead of an etcd quorum read.")
144144
o.cmd.Flags().Int32Var(&o.Shard, "shard", int32(0), "The instances shard nominal (zero indexed) within the total number of shards. (default 0)")

pkg/options/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ type NodeType string
111111
func (n *NodeType) GetNodeFieldSelector(fetchUnscheduledPods bool) string {
112112
if fetchUnscheduledPods {
113113
if string(*n) != "" {
114-
klog.Warningf("spec.nodeName=%s will not be used, because --enable-unscheduled-pods-fetching is set", string(*n))
114+
klog.Warningf("spec.nodeName=%s will not be used, because --track-unscheduled-pods is set", string(*n))
115115
}
116116
klog.InfoS("Using spec.nodeName= to select unscheduable pods without node")
117117
return "spec.nodeName="

pkg/options/types_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ func TestNodeFieldSelector(t *testing.T) {
191191
Wanted: "spec.nodeName=",
192192
},
193193
{
194-
Desc: "have node name when --enable-unscheduled-pods-fetching is set",
194+
Desc: "have node name when --track-unscheduled-pods is set",
195195
Node: "",
196196
Wanted: "spec.nodeName=",
197197
},

0 commit comments

Comments
 (0)