You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Daemonset sharding for pod metrics](#daemonset-sharding-pod-metrics)
48
49
-[Setup](#setup)
49
50
-[Building the Docker container](#building-the-docker-container)
50
51
-[Usage](#usage)
@@ -67,19 +68,17 @@ All additional compatibility is only best effort, or happens to still/already be
67
68
#### Compatibility matrix
68
69
69
70
At most, 5 kube-state-metrics and 5 [kubernetes releases](https://github.com/kubernetes/kubernetes/releases) will be recorded below.
71
+
Generally, it is recommended to use the latest release of kube-state-metrics. If you run a very recent version of Kubernetes, you might want to use an unreleased version to have the full range of supported resources. If you run an older version of Kubernetes, you might need to run an older version in order to have full support for all resources. Be aware, that the maintainers will only support the latest release. Older versions might be supported by interested users of the community.
-`-` The Kubernetes cluster has features the client-go library can't use (additional API objects, deprecated APIs, etc).
81
-
82
-
**Note:** The current kube-state-metrics `v2.0.0 +` releases work on Kubernetes v1.17 & v1.18 excluding Ingress or CertificateSigningRequest resource metrics. If you require those metrics on an older Kubernetes version, use kube-state-metrics `v1.9.8`.
83
82
84
83
#### Resource group version compatibility
85
84
@@ -90,7 +89,7 @@ release.
90
89
#### Container Image
91
90
92
91
The latest container image can be found at:
93
-
*`registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.6.0` (arch: `amd64`, `arm`, `arm64`, `ppc64le` and `s390x`)
92
+
*`registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.7.0` (arch: `amd64`, `arm`, `arm64`, `ppc64le` and `s390x`)
94
93
95
94
### Metrics Documentation
96
95
@@ -238,6 +237,36 @@ This way of deploying shards is useful when you want to manage KSM shards throug
238
237
239
238
The downside of using an auto-sharded setup comes from the rollout strategy supported by `StatefulSet`s. When managed by a `StatefulSet`, pods are replaced one at a time with each pod first getting terminated and then recreated. Besides such rollouts being slower, they will also lead to short downtime for each shard. If a Prometheus scrape happens during a rollout, it can miss some of the metrics exported by kube-state-metrics.
240
239
240
+
### Daemonset sharding for pod metrics
241
+
242
+
For pod metrics, they can be sharded per node with the following flag:
243
+
*`--node`
244
+
245
+
Each kube-state-metrics pod uses FieldSelector (spec.nodeName) to watch/list pod metrics only on the same node.
Copy file name to clipboardExpand all lines: docs/cli-arguments.md
+18-2Lines changed: 18 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,12 +24,25 @@ spec:
24
24
[embedmd]:# (../help.txt)
25
25
```txt
26
26
$ kube-state-metrics -h
27
-
Usage of ./kube-state-metrics:
27
+
kube-state-metrics is a simple service that listens to the Kubernetes API server and generates metrics about the state of the objects.
28
+
29
+
Usage:
30
+
kube-state-metrics [flags]
31
+
kube-state-metrics [command]
32
+
33
+
Available Commands:
34
+
completion Generate completion script for kube-state-metrics.
35
+
help Help about any command
36
+
version Print version information.
37
+
38
+
Flags:
28
39
--add_dir_header If true, adds the file directory to the header of the log messages
29
40
--alsologtostderr log to standard error as well as files (no effect when -logtostderr=true)
30
41
--apiserver string The URL of the apiserver to use as a master
42
+
--config string Path to the kube-state-metrics options config file
31
43
--custom-resource-state-config string Inline Custom Resource State Metrics config YAML (experimental)
32
44
--custom-resource-state-config-file string Path to a Custom Resource State Metrics config file (experimental)
45
+
--custom-resource-state-only Only provide Custom Resource State metrics (experimental)
33
46
--enable-gzip-encoding Gzip responses when requested by clients via 'Accept-Encoding: gzip' header.
34
47
-h, --help Print Help text
35
48
--host string Host to expose metrics on. (default "::")
@@ -42,10 +55,11 @@ Usage of ./kube-state-metrics:
42
55
--metric-allowlist string Comma-separated list of metrics to be exposed. This list comprises of exact metric names and/or regex patterns. The allowlist and denylist are mutually exclusive.
43
56
--metric-annotations-allowlist string Comma-separated list of Kubernetes annotations keys that will be used in the resource' labels metric. By default the metric contains only name and namespace labels. To include additional annotations provide a list of resource names in their plural form and Kubernetes annotation keys you would like to allow for them (Example: '=namespaces=[kubernetes.io/team,...],pods=[kubernetes.io/team],...)'. A single '*' can be provided per resource instead to allow any annotations, but that has severe performance implications (Example: '=pods=[*]').
44
57
--metric-denylist string Comma-separated list of metrics not to be enabled. This list comprises of exact metric names and/or regex patterns. The allowlist and denylist are mutually exclusive.
45
-
--metric-labels-allowlist string Comma-separated list of additional Kubernetes label keys that will be used in the resource' labels metric. By default the metric contains only name and namespace labels. To include additional labels provide a list of resource names in their plural form and Kubernetes label keys you would like to allow for them (Example: '=namespaces=[k8s-label-1,k8s-label-n,...],pods=[app],...)'. A single '*' can be provided per resource instead to allow any labels, but that has severe performance implications (Example: '=pods=[*]').
58
+
--metric-labels-allowlist string Comma-separated list of additional Kubernetes label keys that will be used in the resource' labels metric. By default the metric contains only name and namespace labels. To include additional labels provide a list of resource names in their plural form and Kubernetes label keys you would like to allow for them (Example: '=namespaces=[k8s-label-1,k8s-label-n,...],pods=[app],...)'. A single '*' can be provided per resource instead to allow any labels, but that has severe performance implications (Example: '=pods=[*]'). Additionally, an asterisk (*) can be provided as a key, which will resolve to all resources, i.e., assuming '--resources=deployments,pods', '=*=[*]' will resolve to '=deployments=[*],pods=[*]'.
46
59
--metric-opt-in-list string Comma-separated list of metrics which are opt-in and not enabled by default. This is in addition to the metric allow- and denylists
47
60
--namespaces string Comma-separated list of namespaces to be enabled. Defaults to ""
48
61
--namespaces-denylist string Comma-separated list of namespaces not to be enabled. If namespaces and namespaces-denylist are both set, only namespaces that are excluded in namespaces-denylist will be used.
62
+
--node string Name of the node that contains the kube-state-metrics pod. Most likely it should be passed via the downward API. This is used for daemonset sharding. Only available for resources (pod metrics) that support spec.nodeName fieldSelector. This is experimental.
49
63
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true)
50
64
--pod string Name of the pod that contains the kube-state-metrics container. When set, it is expected that --pod and --pod-namespace are both set. Most likely this should be passed via the downward API. This is used for auto-detecting sharding. If set, this has preference over statically configured sharding. This is experimental, it may be removed without notice.
51
65
--pod-namespace string Name of the namespace of the pod specified by --pod. When set, it is expected that --pod and --pod-namespace are both set. Most likely this should be passed via the downward API. This is used for auto-detecting sharding. If set, this has preference over statically configured sharding. This is experimental, it may be removed without notice.
@@ -63,4 +77,6 @@ Usage of ./kube-state-metrics:
63
77
-v, --v Level number for the log level verbosity
64
78
--version kube-state-metrics build version information
65
79
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
80
+
81
+
Use "kube-state-metrics [command] --help" for more information about a command.
0 commit comments