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
In most cases metrics are available on `/metrics` endpoint of the HTTP server. For components that doesn't expose endpoint by default it can be enabled using `--bind-address` flag.
In a production environment you may want to configure [Prometheus Server](https://prometheus.io/) or some other metrics scraper
36
55
to periodically gather these metrics and make them available in some kind of time series database.
37
56
@@ -40,27 +59,15 @@ Note that {{< glossary_tooltip term_id="kubelet" text="kubelet" >}} also exposes
40
59
If your cluster uses {{< glossary_tooltip term_id="rbac" text="RBAC" >}}, reading metrics requires authorization via a user, group or ServiceAccount with a ClusterRole that allows accessing `/metrics`.
Stable metrics can be guaranteed to not change; Specifically, stability means:
90
+
Alpha metrics have no stability guarantees. These metrics can be modified or deleted at any time.
86
91
87
-
* the metric itself will not be deleted (or renamed)
88
-
* the type of metric will not be modified
92
+
Stable metrics are guaranteed to not change. This means:
93
+
* A stable metric without a deprecated signature will not be deleted or renamed
94
+
* A stable metric's type will not be modified
89
95
90
-
Deprecated metric signal that the metric will eventually be deleted; to find which version, you need to check annotation, which includes from which kubernetes version that metric will be considered deprecated.
96
+
Deprecated metrics are slated for deletion, but are still available for use.
97
+
These metrics include an annotation about the version in which they became deprecated.
91
98
-->
92
99
## 指标生命周期
93
100
94
-
Alpha 指标 → 稳定指标 → 弃用指标 → 隐藏指标 → 删除
101
+
Alpha 指标 → 稳定的指标 → 弃用的指标 → 隐藏的指标 → 删除的指标
95
102
96
-
Alpha 指标没有稳定性保证,因此可以随时对其进行修改或者删除。
103
+
Alpha 指标没有稳定性保证。这些指标可以随时被修改或者删除。
97
104
98
-
稳定指标可以保证不会改变;具体而言,稳定意味着:
105
+
稳定的指标可以保证不会改变。这意味着:
99
106
100
-
* 指标本身不会被删除(或重命名)
101
-
* 指标的类型不会被更改
107
+
* 稳定的、不包含已弃用(deprecated)签名的指标不会被删除(或重命名)
108
+
* 稳定的指标的类型不会被更改
102
109
103
-
已弃用的指标表明该指标最终将被删除;要搞清楚对应版本,你需要检查其注解,
104
-
其中包括从哪个 kubernetes 版本开始,将不再考虑该指标。
110
+
已弃用的指标最终将被删除,不过仍然可用。
111
+
这类指标包含注解,标明其被废弃的版本。
105
112
106
-
过期前:
113
+
<!--
114
+
For example:
107
115
108
-
```
109
-
# HELP some_counter this counts things
110
-
# TYPE some_counter counter
111
-
some_counter 0
112
-
```
116
+
* Before deprecation
117
+
-->
118
+
例如:
113
119
114
-
过期后:
120
+
* 被弃用之前:
115
121
116
-
```
117
-
# HELP some_counter (Deprecated since 1.15.0) this counts things
118
-
# TYPE some_counter counter
119
-
some_counter 0
120
-
```
122
+
```
123
+
# HELP some_counter this counts things
124
+
# TYPE some_counter counter
125
+
some_counter 0
126
+
```
121
127
122
128
<!--
123
-
Once a metric is hidden then by default the metrics is not published for scraping. To use a hidden metric, you need to override the configuration for the relevant cluster component.
129
+
* After deprecation
130
+
-->
131
+
* 被启用之后:
124
132
125
-
Once a metric is deleted, the metric is not published. You cannot change this using an override.
133
+
```
134
+
# HELP some_counter (Deprecated since 1.15.0) this counts things
135
+
# TYPE some_counter counter
136
+
some_counter 0
137
+
```
138
+
139
+
<!--
140
+
Hidden metrics are no longer published for scraping, but are still available for use. To use a hidden metric, please refer to the [Show hidden metrics](#show-hidden-metrics) section.
141
+
142
+
Deleted metrics are no longer published and cannot be used.
126
143
-->
127
-
隐藏指标后,默认情况下,该指标不会发布以供抓取。要使用隐藏指标,你需要覆盖相关集群组件的配置。
144
+
隐藏的指标不会再被发布以供抓取,但仍然可用。
145
+
要使用隐藏指标,请参阅[显式隐藏指标](#show-hidden-metrics)节。
128
146
129
-
指标一旦删除,就不会发布。你无法通过重载配置来改变这一点。
147
+
删除的指标不再被发布,亦无法使用。
130
148
131
149
<!--
132
-
## Show Hidden Metrics
150
+
## Show hidden metrics
133
151
134
152
As described above, admins can enable hidden metrics through a command-line flag on a specific binary. This intends to be used as an escape hatch for admins if they missed the migration of the metrics deprecated in the last release.
135
153
@@ -139,12 +157,13 @@ The flag can only take the previous minor version as it's value. All metrics hid
139
157
140
158
Take metric `A` as an example, here assumed that `A` is deprecated in 1.n. According to metrics deprecated policy, we can reach the following conclusion:
The scheduler exposes optional metrics that reports the requested resources and the desired limits of all running pods. These metrics can be used to build capacity planning dashboards, assess current or historical scheduling limits, quickly identify workloads that cannot schedule due to lack of resources, and compare actual usage to the pod's request.
The kube-scheduler identifies the resource [requests and limits](/docs/concepts/configuration/manage-resources-containers/) configured for each Pod; when either a request or limit is non-zero, the kube-scheduler reports a metrics timeseries. The time series is labelled by:
266
+
- namespace
267
+
- pod name
268
+
- the node where the pod is scheduled or an empty string if not yet scheduled
269
+
- priority
270
+
- the assigned scheduler for that pod
271
+
- the name of the resource (for example, `cpu`)
272
+
- the unit of the resource if known (for example, `cores`)
Once a pod reaches completion (has a `restartPolicy` of `Never` or `OnFailure` and is in the `Succeeded` or `Failed` pod phase, or has been deleted and all containers have a terminated state) the series is no longer reported since the scheduler is now free to schedule other pods to run. The two metrics are called `kube_pod_resource_request` and `kube_pod_resource_limit`.
288
+
289
+
The metrics are exposed at the HTTP endpoint `/metrics/resources` and require the same authorization as the `/metrics`
290
+
endpoint on the scheduler. You must use the `--show-hidden-metrics-for-version=1.20` flag to expose these alpha stability metrics.
291
+
-->
292
+
一旦 Pod 进入完成状态(其 `restartPolicy` 为 `Never` 或 `OnFailure`,且
0 commit comments