Skip to content

Commit

Permalink
rename to --enable-unscheduled-pods-fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
CatherineF-dev committed Jun 13, 2024
1 parent 8d5c6d9 commit 5d51a44
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ spec:
fieldPath: spec.nodeName
```

To track metrics for unassigned pods, you need to add an additional deployment and set `--fetch-unscheduled-pods`, as shown in the following example:
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:

```
apiVersion: apps/v1
Expand All @@ -293,7 +293,7 @@ spec:
name: kube-state-metrics
args:
- --resources=pods
- --fetch-unscheduled-pods
- --enable-unscheduled-pods-fetching
```

Other metrics can be sharded via [Horizontal sharding](#horizontal-sharding).
Expand Down
4 changes: 2 additions & 2 deletions README.md.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ spec:
fieldPath: spec.nodeName
```

To track metrics for unassigned pods, you need to add an additional deployment and set `--fetch-unscheduled-pods`, as shown in the following example:
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:

```
apiVersion: apps/v1
Expand All @@ -294,7 +294,7 @@ spec:
name: kube-state-metrics
args:
- --resources=pods
- --fetch-unscheduled-pods
- --enable-unscheduled-pods-fetching
```

Other metrics can be sharded via [Horizontal sharding](#horizontal-sharding).
Expand Down
2 changes: 1 addition & 1 deletion docs/developer/cli-arguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Flags:
--custom-resource-state-config-file string Path to a Custom Resource State Metrics config file (experimental)
--custom-resource-state-only Only provide Custom Resource State metrics (experimental)
--enable-gzip-encoding Gzip responses when requested by clients via 'Accept-Encoding: gzip' header.
--fetch-unscheduled-pods This configuration is used in conjunction with node configuration. When this configuration is true, node configuration is empty and the metric of no scheduled pods is scraped. This is experimental.
--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 no scheduled pods is scraped. This is experimental.
-h, --help Print Help text
--host string Host to expose metrics on. (default "::")
--kubeconfig string Absolute path to the kubeconfig file
Expand Down
2 changes: 1 addition & 1 deletion examples/daemonsetsharding/deployment-no-node-pods.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
containers:
- args:
- --resources=pods
- --fetch-unscheduled-pods
- --enable-unscheduled-pods-fetching
image: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.12.0
livenessProbe:
httpGet:
Expand Down
4 changes: 2 additions & 2 deletions jsonnet/kube-state-metrics/kube-state-metrics.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@
local c = ksm.deployment.spec.template.spec.containers[0] {
args: [
'--resources=pods',
'--fetch-unscheduled-pods',
'--enable-unscheduled-pods-fetching',
],
name: shardksmname,
};
Expand Down Expand Up @@ -410,7 +410,7 @@
local c = ksm.deployment.spec.template.spec.containers[0] {
args: [
'--resources=pods',
'--fetch-unscheduled-pods',
'--enable-unscheduled-pods-fetching',
],
};
local shardksmname = ksm.name + "-no-node-pods";
Expand Down
2 changes: 1 addition & 1 deletion pkg/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func RunKubeStateMetrics(ctx context.Context, opts *options.Options) error {

namespaces := opts.Namespaces.GetNamespaces()
nsFieldSelector := namespaces.GetExcludeNSFieldSelector(opts.NamespacesDenylist)
nodeFieldSelector := opts.Node.GetNodeFieldSelector(opts.FetchUnscheduledPods)
nodeFieldSelector := opts.Node.GetNodeFieldSelector(opts.EnableUnscheduledPodsFetching)
merged, err := storeBuilder.MergeFieldSelectors([]string{nsFieldSelector, nodeFieldSelector})
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions pkg/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type Options struct {
Namespaces NamespaceList `yaml:"namespaces"`
NamespacesDenylist NamespaceList `yaml:"namespaces_denylist"`
Node NodeType `yaml:"node"`
FetchUnscheduledPods bool `yaml:"fetch_unscheduled_pods"`
EnableUnscheduledPodsFetching bool `yaml:"enable_unscheduled_pods_fetching"`
Pod string `yaml:"pod"`
Port int `yaml:"port"`
Resources ResourceSet `yaml:"resources"`
Expand Down Expand Up @@ -121,7 +121,7 @@ func (o *Options) AddFlags(cmd *cobra.Command) {

o.cmd.Flags().BoolVar(&o.CustomResourcesOnly, "custom-resource-state-only", false, "Only provide Custom Resource State metrics (experimental)")
o.cmd.Flags().BoolVar(&o.EnableGZIPEncoding, "enable-gzip-encoding", false, "Gzip responses when requested by clients via 'Accept-Encoding: gzip' header.")
o.cmd.Flags().BoolVar(&o.FetchUnscheduledPods, "fetch-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 no scheduled pods is scraped. This is experimental.")
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 no scheduled pods is scraped. This is experimental.")
o.cmd.Flags().BoolVarP(&o.Help, "help", "h", false, "Print Help text")
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.")
o.cmd.Flags().Int32Var(&o.Shard, "shard", int32(0), "The instances shard nominal (zero indexed) within the total number of shards. (default 0)")
Expand Down

0 comments on commit 5d51a44

Please sign in to comment.