Skip to content

Commit 1225c94

Browse files
authored
Merge pull request #44391 from my-git9/flow-control-492
[zh-cn] sync cluster-administration/flow-control.md system-metrics.md
2 parents 16575a9 + 9b34cf6 commit 1225c94

File tree

2 files changed

+56
-47
lines changed

2 files changed

+56
-47
lines changed

content/zh-cn/docs/concepts/cluster-administration/flow-control.md

Lines changed: 28 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ weight: 110
1313

1414
<!-- overview -->
1515

16-
{{< feature-state state="beta" for_k8s_version="v1.20" >}}
16+
{{< feature-state state="stable" for_k8s_version="v1.29" >}}
1717

1818
<!--
1919
Controlling the behavior of the Kubernetes API server in an overload situation
@@ -80,48 +80,38 @@ APF 适用于 **watch** 请求。当 APF 被禁用时,**watch** 请求不受 `
8080
## 启用/禁用 API 优先级和公平性 {#enabling-api-priority-and-fairness}
8181

8282
<!--
83-
The API Priority and Fairness feature is controlled by a feature gate
84-
and is enabled by default. See [Feature
85-
Gates](/docs/reference/command-line-tools-reference/feature-gates/)
86-
for a general explanation of feature gates and how to enable and
87-
disable them. The name of the feature gate for APF is
88-
"APIPriorityAndFairness". This feature also involves an {{<
89-
glossary_tooltip term_id="api-group" text="API Group" >}} with: (a) a
90-
`v1alpha1` version and a `v1beta1` version, disabled by default, and
91-
(b) `v1beta2` and `v1beta3` versions, enabled by default. You can
92-
disable the feature gate and API group beta versions by adding the
93-
following command-line flags to your `kube-apiserver` invocation:
94-
-->
95-
API 优先级与公平性(APF)特性由特性门控控制,默认情况下启用。
96-
有关特性门控的一般性描述以及如何启用和禁用特性门控
97-
请参见[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)
98-
APF 的特性门控称为 `APIPriorityAndFairness`
83+
The API Priority and Fairness feature is controlled by a command-line flag
84+
and is enabled by default. See
85+
[Options](/docs/reference/command-line-tools-reference/kube-apiserver/options/)
86+
for a general explanation of the available kube-apiserver command-line
87+
options and how to enable and disable them. The name of the
88+
command-line option for APF is "--enable-priority-and-fairness". This feature
89+
also involves an {{<glossary_tooltip term_id="api-group" text="API Group" >}}
90+
with: (a) a stable `v1` version, introduced in 1.29, and
91+
enabled by default (b) a `v1beta3` version, enabled by default, and
92+
deprecated in v1.29. You can
93+
disable the API group beta version `v1beta3` by adding the
94+
-->
95+
API 优先级与公平性(APF)特性由命令行标志控制,默认情况下启用。
96+
有关可用 kube-apiserver 命令行参数以及如何启用和禁用的说明
97+
请参见[参数](/zh-cn/docs/reference/command-line-tools-reference/kube-apiserver/options/)
98+
APF 的命令行参数是 "--enable-priority-and-fairness"
9999
此特性也与某个 {{< glossary_tooltip term_id="api-group" text="API 组" >}}相关:
100-
(a) `v1alpha1``v1beta1` 版本,默认被禁用
101-
(b) `v1beta2``v1beta3` 版本,默认被启用。
102-
你可以在启动 `kube-apiserver` 时,添加以下命令行标志来禁用此功能门控及 API Beta 组:
100+
(a) 稳定的 `v1` 版本,在 1.29 中引入,默认启用
101+
(b) `v1beta3` 版本,默认被启用,在 1.29 中被弃用
102+
你可以通过添加以下内容来禁用 Beta 版的 `v1beta3` API 组:
103103

104104
```shell
105105
kube-apiserver \
106-
--feature-gates=APIPriorityAndFairness=false \
107-
--runtime-config=flowcontrol.apiserver.k8s.io/v1beta2=false,flowcontrol.apiserver.k8s.io/v1beta3=false \
106+
--runtime-config=flowcontrol.apiserver.k8s.io/v1beta3=false \
108107
# ...其他配置不变
109108
```
110109

111-
<!--
112-
Alternatively, you can enable the v1alpha1 and v1beta1 versions of the API group
113-
with `--runtime-config=flowcontrol.apiserver.k8s.io/v1alpha1=true,flowcontrol.apiserver.k8s.io/v1beta1=true`.
114-
-->
115-
或者,你也可以通过
116-
`--runtime-config=flowcontrol.apiserver.k8s.io/v1alpha1=true,flowcontrol.apiserver.k8s.io/v1beta1=true`
117-
启用 API 组的 v1alpha1 和 v1beta1 版本。
118-
119110
<!--
120111
The command-line flag `--enable-priority-and-fairness=false` will disable the
121-
API Priority and Fairness feature, even if other flags have enabled it.
112+
API Priority and Fairness feature.
122113
-->
123-
命令行标志 `--enable-priority-fairness=false` 将彻底禁用 APF 特性,
124-
即使其他标志启用它也是无效。
114+
命令行标志 `--enable-priority-fairness=false` 将彻底禁用 APF 特性。
125115

126116
<!--
127117
## Concepts
@@ -312,23 +302,20 @@ server.
312302
## Resources
313303
314304
The flow control API involves two kinds of resources.
315-
[PriorityLevelConfigurations](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#prioritylevelconfiguration-v1beta2-flowcontrol-apiserver-k8s-io)
305+
[PriorityLevelConfigurations](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#prioritylevelconfiguration-v1-flowcontrol-apiserver-k8s-io)
316306
define the available priority levels, the share of the available concurrency
317307
budget that each can handle, and allow for fine-tuning queuing behavior.
318-
[FlowSchemas](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#flowschema-v1beta2-flowcontrol-apiserver-k8s-io)
308+
[FlowSchemas](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#flowschema-v1-flowcontrol-apiserver-k8s-io)
319309
are used to classify individual inbound requests, matching each to a
320-
single PriorityLevelConfiguration. There is also a `v1alpha1` version
321-
of the same API group, and it has the same Kinds with the same syntax and
322-
semantics.
310+
single PriorityLevelConfiguration.
323311
-->
324312
## 资源 {#resources}
325313

326314
流控 API 涉及两种资源。
327-
[PriorityLevelConfiguration](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#prioritylevelconfiguration-v1beta2-flowcontrol-apiserver-k8s-io)
315+
[PriorityLevelConfiguration](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#prioritylevelconfiguration-v1-flowcontrol-apiserver-k8s-io)
328316
定义可用的优先级和可处理的并发预算量,还可以微调排队行为。
329-
[FlowSchema](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#flowschema-v1beta2-flowcontrol-apiserver-k8s-io)
317+
[FlowSchema](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#flowschema-v1-flowcontrol-apiserver-k8s-io)
330318
用于对每个入站请求进行分类,并与一个 PriorityLevelConfiguration 相匹配。
331-
此外同一 API 组还有一个 `v1alpha1` 版本,其中包含语法和语义都相同的资源类别。
332319

333320
<!--
334321
### PriorityLevelConfiguration

content/zh-cn/docs/concepts/cluster-administration/system-metrics.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ This format is structured plain text, designed so that people and machines can b
2525
-->
2626
通过系统组件指标可以更好地了解系统组个内部发生的情况。系统组件指标对于构建仪表板和告警特别有用。
2727

28-
Kubernetes 组件以 [Prometheus 格式](https://prometheus.io/docs/instrumenting/exposition_formats/)
29-
生成度量值。
28+
Kubernetes 组件以
29+
[Prometheus 格式](https://prometheus.io/docs/instrumenting/exposition_formats/)生成度量值。
3030
这种格式是结构化的纯文本,旨在使人和机器都可以阅读。
3131

3232
<!-- body -->
@@ -65,7 +65,7 @@ If your cluster uses {{< glossary_tooltip term_id="rbac" text="RBAC" >}}, readin
6565
authorization via a user, group or ServiceAccount with a ClusterRole that allows accessing
6666
`/metrics`. For example:
6767
-->
68-
在生产环境中,你可能需要配置 [Prometheus 服务器](https://prometheus.io/)
68+
在生产环境中,你可能需要配置 [Prometheus 服务器](https://prometheus.io/)
6969
某些其他指标搜集器以定期收集这些指标,并使它们在某种时间序列数据库中可用。
7070

7171
请注意,{{< glossary_tooltip term_id="kubelet" text="kubelet" >}} 还会在 `/metrics/cadvisor`
@@ -255,10 +255,9 @@ of all running pods. These metrics can be used to build capacity planning dashbo
255255
current or historical scheduling limits, quickly identify workloads that cannot schedule due to
256256
lack of resources, and compare actual usage to the pod's request.
257257
-->
258-
调度器会暴露一些可选的指标,报告所有运行中 Pods 所请求的资源和期望的约束值。
258+
调度器会暴露一些可选的指标,报告所有运行中 Pod 所请求的资源和期望的约束值。
259259
这些指标可用来构造容量规划监控面板、访问调度约束的当前或历史数据、
260-
快速发现因为缺少资源而无法被调度的负载,或者将 Pod 的实际资源用量
261-
与其请求值进行比较。
260+
快速发现因为缺少资源而无法被调度的负载,或者将 Pod 的实际资源用量与其请求值进行比较。
262261

263262
<!--
264263
The kube-scheduler identifies the resource [requests and limits](/docs/concepts/configuration/manage-resources-containers/)
@@ -352,6 +351,29 @@ Here is an example:
352351
--allow-label-value number_count_metric,odd_number='1,3,5', number_count_metric,even_number='2,4,6', date_gauge_metric,weekend='Saturday,Sunday'
353352
```
354353

354+
<!--
355+
In addition to specifying this from the CLI, this can also be done within a configuration file. You
356+
can specify the path to that configuration file using the `--allow-metric-labels-manifest` command
357+
line argument to a component. Here's an example of the contents of that configuration file:
358+
-->
359+
除了从 CLI 中指定之外,还可以在配置文件中完成此操作。
360+
你可以使用组件的 `--allow-metric-labels-manifest` 命令行参数指定该配置文件的路径。
361+
以下是该配置文件的内容示例:
362+
363+
```yaml
364+
allow-list:
365+
- "metric1,label2": "v1,v2,v3"
366+
- "metric2,label1": "v1,v2,v3"
367+
```
368+
369+
<!--
370+
Additionally, the `cardinality_enforcement_unexpected_categorizations_total` meta-metric records the
371+
count of unexpected categorizations during cardinality enforcement, that is, whenever a label value
372+
is encountered that is not allowed with respect to the allow-list contraints.
373+
-->
374+
此外,`cardinality_enforcement_unexpected_categorizations_total`
375+
元指标记录基数执行期间意外分类的计数,即每当遇到允许列表约束不允许的标签值时。
376+
355377
## {{% heading "whatsnext" %}}
356378

357379
<!--

0 commit comments

Comments
 (0)