Skip to content

Commit 3a48c1e

Browse files
authored
Merge pull request #35622 from windsonsea/kubeletyhf
[zh-cn] resync /concepts/cluster-administration/flow-control.md
2 parents 3a5a161 + b83107e commit 3a48c1e

File tree

1 file changed

+27
-24
lines changed

1 file changed

+27
-24
lines changed

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

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ that the most important requests get through in a period of high traffic.
2020
-->
2121
对于集群管理员来说,控制 Kubernetes API 服务器在过载情况下的行为是一项关键任务。
2222
{{< glossary_tooltip term_id="kube-apiserver" text="kube-apiserver" >}}
23-
有一些控件(例如:命令行标志 `--max-requests-inflight``--max-mutating-requests-inflight` ),
23+
有一些控件(例如:命令行标志 `--max-requests-inflight``--max-mutating-requests-inflight`),
2424
可以限制将要接受的未处理的请求,从而防止过量请求入站,潜在导致 API 服务器崩溃。
2525
但是这些标志不足以保证在高流量期间,最重要的请求仍能被服务器接受。
2626

@@ -76,9 +76,9 @@ for a general explanation of feature gates and how to enable and
7676
disable them. The name of the feature gate for APF is
7777
"APIPriorityAndFairness". This feature also involves an {{<
7878
glossary_tooltip term_id="api-group" text="API Group" >}} with: (a) a
79-
`v1alpha1` version, disabled by default, and (b) a `v1beta1` and
80-
`v1beta21 versions, enabled by default. You can disable the feature
81-
gate and API group beta version by adding the following
79+
`v1alpha1` version, disabled by default, and (b) `v1beta1` and
80+
`v1beta2` versions, enabled by default. You can disable the feature
81+
gate and API group beta versions by adding the following
8282
command-line flags to your `kube-apiserver` invocation:
8383
-->
8484
API 优先级与公平性(APF)特性由特性门控控制,默认情况下启用。
@@ -184,7 +184,7 @@ many instances should authenticate with distinct usernames
184184
公平排队算法在处理具有相同优先级的请求时,实现了上述场景。
185185
每个请求都被分配到某个 **流(Flow)** 中,该 **** 由对应的 FlowSchema 的名字加上一个
186186
**流区分项(Flow Distinguisher)** 来标识。
187-
这里的流区分项可以是发出请求的用户、目标资源的名称空间或什么都不是
187+
这里的流区分项可以是发出请求的用户、目标资源的名字空间或什么都不是
188188
系统尝试为不同流中具有相同优先级的请求赋予近似相等的权重。
189189
要启用对不同实例的不同处理方式,多实例的控制器要分别用不同的用户名来执行身份认证。
190190

@@ -227,10 +227,10 @@ server.
227227
## Resources
228228
229229
The flow control API involves two kinds of resources.
230-
[PriorityLevelConfigurations](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#prioritylevelconfiguration-v1beta1-flowcontrol-apiserver-k8s-io)
230+
[PriorityLevelConfigurations](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#prioritylevelconfiguration-v1beta2-flowcontrol-apiserver-k8s-io)
231231
define the available isolation classes, the share of the available concurrency
232232
budget that each can handle, and allow for fine-tuning queuing behavior.
233-
[FlowSchemas](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#flowschema-v1beta1-flowcontrol-apiserver-k8s-io)
233+
[FlowSchemas](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#flowschema-v1beta2-flowcontrol-apiserver-k8s-io)
234234
are used to classify individual inbound requests, matching each to a
235235
single PriorityLevelConfiguration. There is also a `v1alpha1` version
236236
of the same API group, and it has the same Kinds with the same syntax and
@@ -239,9 +239,9 @@ semantics.
239239
## 资源 {#Resources}
240240

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

@@ -426,7 +426,7 @@ the wildcard `*` may be specified to match all values for the given field,
426426
effectively removing it from consideration.
427427
-->
428428
对于 `subjects` 中的 `name` 字段和资源和非资源规则的
429-
`verbs``apiGroups``resources``namespaces``nonResourceURLs` 字段,
429+
`verbs``apiGroups``resources``namespaces``nonResourceURLs` 字段,
430430
可以指定通配符 `*` 来匹配任意值,从而有效地忽略该字段。
431431

432432
<!--
@@ -441,8 +441,8 @@ considered part of a single flow. The correct choice for a given FlowSchema
441441
depends on the resource and your particular environment.
442442
-->
443443
FlowSchema 的 `distinguisherMethod.type` 字段决定了如何把与该模式匹配的请求分散到各个流中。
444-
可能是 `ByUser` ,在这种情况下,一个请求用户将无法饿死其他容量的用户;
445-
或者是 `ByNamespace` ,在这种情况下,一个名称空间中的资源请求将无法饿死其它名称空间的资源请求
444+
可能是 `ByUser`,在这种情况下,一个请求用户将无法饿死其他容量的用户;
445+
或者是 `ByNamespace`,在这种情况下,一个名字空间中的资源请求将无法饿死其它名字空间的资源请求
446446
或者它可以为空(或者可以完全省略 `distinguisherMethod`),
447447
在这种情况下,与此 FlowSchema 匹配的请求将被视为单个流的一部分。
448448
资源和你的特定环境决定了如何选择正确一个 FlowSchema。
@@ -543,7 +543,7 @@ The suggested configuration groups requests into six priority levels:
543543
causes more expensive traffic as the new controllers sync their informers.
544544
-->
545545
* `leader-election` 优先级用于内置控制器的领导选举的请求
546-
(特别是来自 `kube-system` 名称空间中 `system:kube-controller-manager`
546+
(特别是来自 `kube-system` 名字空间中 `system:kube-controller-manager`
547547
`system:kube-scheduler` 用户和服务账号,针对 `endpoints``configmaps``leases` 的请求)。
548548
将这些请求与其他流量相隔离非常重要,因为领导者选举失败会导致控制器发生故障并重新启动,
549549
这反过来会导致新启动的控制器在同步信息时,流量开销更大。
@@ -758,8 +758,7 @@ should refer to the documentation for your version.
758758
-->
759759
在 Kubernetes v1.20 之前的版本中,标签 `flow_schema``priority_level`
760760
的名称有时被写作 `flowSchema``priorityLevel`,即存在不一致的情况。
761-
如果你在运行 Kubernetes v1.19 或者更早版本,你需要参考你所使用的集群
762-
版本对应的文档。
761+
如果你在运行 Kubernetes v1.19 或者更早版本,你需要参考你所使用的集群版本对应的文档。
763762
{{< /note >}}
764763

765764
<!--
@@ -782,7 +781,7 @@ poorly-behaved workloads that may be harming system health.
782781
-->
783782
* `apiserver_flowcontrol_rejected_requests_total` 是一个计数器向量,
784783
记录被拒绝的请求数量(自服务器启动以来累计值),
785-
由标签 `flow_chema`(表示与请求匹配的 FlowSchema)`priority_evel`
784+
由标签 `flow_chema`(表示与请求匹配的 FlowSchema)`priority_evel`
786785
(表示分配给请该求的优先级)和 `reason` 来区分。
787786
`reason` 标签将具有以下值之一:
788787
<!--
@@ -794,10 +793,10 @@ poorly-behaved workloads that may be harming system health.
794793
* `time-out`, indicating that the request was still in the queue
795794
when its queuing time limit expired.
796795
-->
797-
* `queue-full` ,表明已经有太多请求排队,
796+
* `queue-full`,表明已经有太多请求排队,
798797
* `concurrency-limit`,表示将 PriorityLevelConfiguration 配置为
799-
`Reject` 而不是 `Queue` ,或者
800-
* `time-out`, 表示在其排队时间超期的请求仍在队列中。
798+
`Reject` 而不是 `Queue`,或者
799+
* `time-out`表示在其排队时间超期的请求仍在队列中。
801800

802801
<!--
803802
* `apiserver_flowcontrol_dispatched_requests_total` is a counter
@@ -834,12 +833,17 @@ poorly-behaved workloads that may be harming system health.
834833
requests, broken down by the labels `phase` (which takes on the
835834
values `waiting` and `executing`) and `request_kind` (which takes on
836835
the values `mutating` and `readOnly`). The observations are made
837-
periodically at a high rate.
836+
periodically at a high rate. Each observed value is a ratio,
837+
between 0 and 1, of a number of requests divided by the
838+
corresponding limit on the number of requests (queue length limit
839+
for waiting and concurrency limit for executing).
838840
-->
839841
* `apiserver_flowcontrol_read_vs_write_request_count_samples` 是一个直方图向量,
840842
记录当前请求数量的观察值,
841843
由标签 `phase`(取值为 `waiting``executing`)和 `request_kind`
842844
(取值 `mutating``readOnly`)拆分。定期以高速率观察该值。
845+
每个观察到的值是一个介于 0 和 1 之间的比值,计算方式为请求数除以该请求数的对应限制
846+
(等待的队列长度限制和执行所用的并发限制)。
843847

844848
<!--
845849
* `apiserver_flowcontrol_read_vs_write_request_count_watermarks` is a
@@ -941,7 +945,7 @@ poorly-behaved workloads that may be harming system health.
941945
level are longer than those for other priority levels, it may be appropriate
942946
to increase that PriorityLevelConfiguration's concurrency shares.
943947
-->
944-
直方图中的离群值在这里表示单个流(即,一个用户或一个名称空间的请求
948+
直方图中的离群值在这里表示单个流(即,一个用户或一个名字空间的请求
945949
具体取决于配置)正在疯狂地向 API 服务器发请求,并受到限制。
946950
相反,如果一个优先级的直方图显示该优先级的所有队列都比其他优先级的队列长,
947951
则增加 PriorityLevelConfiguration 的并发份额是比较合适的。
@@ -979,8 +983,7 @@ poorly-behaved workloads that may be harming system health.
979983
requests assigned to that priority level.
980984
-->
981985
由于每个 FlowSchema 总会给请求分配 PriorityLevelConfiguration,
982-
因此你可以为一个优先级添加所有 FlowSchema 的直方图,以获取分配给
983-
该优先级的请求的有效直方图。
986+
因此你可以为一个优先级添加所有 FlowSchema 的直方图,以获取分配给该优先级的请求的有效直方图。
984987
{{< /note >}}
985988

986989
<!--
@@ -1062,7 +1065,7 @@ serves the following additional paths at its HTTP[S] ports.
10621065
- `/debug/api_priority_and_fairness/dump_requests` - a listing of all the requests
10631066
that are currently waiting in a queue. You can fetch like this:
10641067
-->
1065-
- `/debug/api_priority_and_fairness/dump_requests` ——当前正在队列中等待的所有请求的列表。
1068+
- `/debug/api_priority_and_fairness/dump_requests` —— 当前正在队列中等待的所有请求的列表。
10661069
你可以这样获取:
10671070

10681071
```shell

0 commit comments

Comments
 (0)