@@ -833,35 +833,6 @@ that originate from outside your cluster.
833
833
834
834
{{% code_sample file="priority-and-fairness/health-for-strangers.yaml" %}}
835
835
836
- <!--
837
- ## Diagnostics
838
-
839
- Every HTTP response from an API server with the priority and fairness feature
840
- enabled has two extra headers: `X-Kubernetes-PF-FlowSchema-UID` and
841
- `X-Kubernetes-PF-PriorityLevel-UID`, noting the flow schema that matched the request
842
- and the priority level to which it was assigned, respectively. The API objects'
843
- names are not included in these headers in case the requesting user does not
844
- have permission to view them, so when debugging you can use a command like
845
- -->
846
- ## 问题诊断 {#diagnostics}
847
-
848
- 启用了 APF 的 API 服务器,它每个 HTTP 响应都有两个额外的 HTTP 头:
849
- ` X-Kubernetes-PF-FlowSchema-UID ` 和 ` X-Kubernetes-PF-PriorityLevel-UID ` ,
850
- 注意与请求匹配的 FlowSchema 和已分配的优先级。
851
- 如果请求用户没有查看这些对象的权限,则这些 HTTP 头中将不包含 API 对象的名称,
852
- 因此在调试时,你可以使用类似如下的命令:
853
-
854
- ``` shell
855
- kubectl get flowschemas -o custom-columns=" uid:{metadata.uid},name:{metadata.name}"
856
- kubectl get prioritylevelconfigurations -o custom-columns=" uid:{metadata.uid},name:{metadata.name}"
857
- ```
858
-
859
- <!--
860
- to get a mapping of UIDs to names for both FlowSchemas and
861
- PriorityLevelConfigurations.
862
- -->
863
- 来获取 UID 到 FlowSchema 的名称和 UID 到 PriorityLevelConfiguration 的名称的映射。
864
-
865
836
<!--
866
837
## Observability
867
838
@@ -1222,168 +1193,6 @@ poorly-behaved workloads that may be harming system health.
1222
1193
但由于并发度不足而没有被分派,
1223
1194
由标签 ` flow_schema ` 和 ` priority_level ` 进一步区分。
1224
1195
1225
- <!--
1226
- ### Debug endpoints
1227
-
1228
- When you enable the API Priority and Fairness feature, the `kube-apiserver`
1229
- serves the following additional paths at its HTTP(S) ports.
1230
- -->
1231
- ### 调试端点 {#debug-endpoints}
1232
-
1233
- 启用 APF 特性后,kube-apiserver 会在其 HTTP/HTTPS 端口提供以下路径:
1234
-
1235
- <!--
1236
- - `/debug/api_priority_and_fairness/dump_priority_levels` - a listing of
1237
- all the priority levels and the current state of each. You can fetch like this:
1238
- -->
1239
- - ` /debug/api_priority_and_fairness/dump_priority_levels ` ——
1240
- 所有优先级及其当前状态的列表。你可以这样获取:
1241
-
1242
- ``` shell
1243
- kubectl get --raw /debug/api_priority_and_fairness/dump_priority_levels
1244
- ```
1245
-
1246
- <!--
1247
- The output is similar to this:
1248
- -->
1249
- 输出类似于:
1250
-
1251
- ``` none
1252
- PriorityLevelName, ActiveQueues, IsIdle, IsQuiescing, WaitingRequests, ExecutingRequests, DispatchedRequests, RejectedRequests, TimedoutRequests, CancelledRequests
1253
- catch-all, 0, true, false, 0, 0, 1, 0, 0, 0
1254
- exempt, <none>, <none>, <none>, <none>, <none>, <none>, <none>, <none>, <none>
1255
- global-default, 0, true, false, 0, 0, 46, 0, 0, 0
1256
- leader-election, 0, true, false, 0, 0, 4, 0, 0, 0
1257
- node-high, 0, true, false, 0, 0, 34, 0, 0, 0
1258
- system, 0, true, false, 0, 0, 48, 0, 0, 0
1259
- workload-high, 0, true, false, 0, 0, 500, 0, 0, 0
1260
- workload-low, 0, true, false, 0, 0, 0, 0, 0, 0
1261
- ```
1262
-
1263
- <!--
1264
- - `/debug/api_priority_and_fairness/dump_queues` - a listing of all the
1265
- queues and their current state. You can fetch like this:
1266
- -->
1267
- - ` /debug/api_priority_and_fairness/dump_queues ` —— 所有队列及其当前状态的列表。
1268
- 你可以这样获取:
1269
-
1270
- ``` shell
1271
- kubectl get --raw /debug/api_priority_and_fairness/dump_queues
1272
- ```
1273
-
1274
- <!--
1275
- The output is similar to this:
1276
- -->
1277
- 输出类似于:
1278
-
1279
- ``` none
1280
- PriorityLevelName, Index, PendingRequests, ExecutingRequests, VirtualStart,
1281
- workload-high, 0, 0, 0, 0.0000,
1282
- workload-high, 1, 0, 0, 0.0000,
1283
- workload-high, 2, 0, 0, 0.0000,
1284
- ...
1285
- leader-election, 14, 0, 0, 0.0000,
1286
- leader-election, 15, 0, 0, 0.0000,
1287
- ```
1288
-
1289
- <!--
1290
- - `/debug/api_priority_and_fairness/dump_requests` - a listing of all the requests
1291
- that are currently waiting in a queue. You can fetch like this:
1292
- -->
1293
- - ` /debug/api_priority_and_fairness/dump_requests ` —— 当前正在队列中等待的所有请求的列表。
1294
- 你可以这样获取:
1295
-
1296
- ``` shell
1297
- kubectl get --raw /debug/api_priority_and_fairness/dump_requests
1298
- ```
1299
-
1300
- <!--
1301
- The output is similar to this:
1302
- -->
1303
- 输出类似于:
1304
-
1305
- ``` none
1306
- PriorityLevelName, FlowSchemaName, QueueIndex, RequestIndexInQueue, FlowDistingsher, ArriveTime,
1307
- exempt, <none>, <none>, <none>, <none>, <none>,
1308
- system, system-nodes, 12, 0, system:node:127.0.0.1, 2020-07-23T15:26:57.179170694Z,
1309
- ```
1310
-
1311
- <!--
1312
- In addition to the queued requests, the output includes one phantom line
1313
- for each priority level that is exempt from limitation.
1314
- -->
1315
- 针对每个优先级别,输出中还包含一条虚拟记录,对应豁免限制。
1316
-
1317
- <!--
1318
- You can get a more detailed listing with a command like this:
1319
- -->
1320
- 你可以使用以下命令获得更详细的清单:
1321
-
1322
- ``` shell
1323
- kubectl get --raw ' /debug/api_priority_and_fairness/dump_requests?includeRequestDetails=1'
1324
- ```
1325
-
1326
- <!--
1327
- The output is similar to this:
1328
- -->
1329
- 输出类似于:
1330
-
1331
- ``` none
1332
- PriorityLevelName, FlowSchemaName, QueueIndex, RequestIndexInQueue, FlowDistingsher, ArriveTime, UserName, Verb, APIPath, Namespace, Name, APIVersion, Resource, SubResource,
1333
- system, system-nodes, 12, 0, system:node:127.0.0.1, 2020-07-23T15:31:03.583823404Z, system:node:127.0.0.1, create, /api/v1/namespaces/scaletest/configmaps,
1334
- system, system-nodes, 12, 1, system:node:127.0.0.1, 2020-07-23T15:31:03.594555947Z, system:node:127.0.0.1, create, /api/v1/namespaces/scaletest/configmaps,
1335
- ```
1336
-
1337
- <!--
1338
- ### Debug logging
1339
-
1340
- At `-v=3` or more verbose the server outputs an httplog line for every
1341
- request, and it includes the following attributes.
1342
- -->
1343
- ### 调试日志生成行为 {#debug-logging}
1344
-
1345
- 在 ` -v=3 ` 或更详细的情况下,服务器会为每个请求输出一行 httplog,它包括以下属性。
1346
-
1347
- <!--
1348
- - `apf_fs`: the name of the flow schema to which the request was classified.
1349
- - `apf_pl`: the name of the priority level for that flow schema.
1350
- - `apf_iseats`: the number of seats determined for the initial
1351
- (normal) stage of execution of the request.
1352
- - `apf_fseats`: the number of seats determined for the final stage of
1353
- execution (accounting for the associated WATCH notifications) of the
1354
- request.
1355
- - `apf_additionalLatency`: the duration of the final stage of
1356
- execution of the request.
1357
- -->
1358
- - ` apf_fs ` :请求被分类到的 FlowSchema 的名称。
1359
- - ` apf_pl ` :该 FlowSchema 的优先级名称。
1360
- - ` apf_iseats ` :为请求执行的初始(正常)阶段确定的席位数量。
1361
- - ` apf_fseats ` :为请求的最后执行阶段(考虑关联的 WATCH 通知)确定的席位数量。
1362
- - ` apf_additionalLatency ` :请求执行最后阶段的持续时间。
1363
-
1364
- <!--
1365
- At higher levels of verbosity there will be log lines exposing details
1366
- of how APF handled the request, primarily for debugging purposes.
1367
- -->
1368
- 在更高级别的精细度下,将有日志行揭示 APF 如何处理请求的详细信息,主要用于调试目的。
1369
-
1370
- <!--
1371
- ### Response headers
1372
-
1373
- APF adds the following two headers to each HTTP response message.
1374
-
1375
- - `X-Kubernetes-PF-FlowSchema-UID` holds the UID of the FlowSchema
1376
- object to which the corresponding request was classified.
1377
- - `X-Kubernetes-PF-PriorityLevel-UID` holds the UID of the
1378
- PriorityLevelConfiguration object associated with that FlowSchema.
1379
- -->
1380
- ### 响应头 {#response-headers}
1381
-
1382
- APF 将以下两个头添加到每个 HTTP 响应消息中。
1383
-
1384
- - ` X-Kubernetes-PF-FlowSchema-UID ` 保存相应请求被分类到的 FlowSchema 对象的 UID。
1385
- - ` X-Kubernetes-PF-PriorityLevel-UID ` 保存与该 FlowSchema 关联的 PriorityLevelConfiguration 对象的 UID。
1386
-
1387
1196
<!--
1388
1197
## Good practices for using API Priority and Fairness
1389
1198
@@ -1598,12 +1407,14 @@ FlowSchema 将这些列表调用与其他请求隔离开来。
1598
1407
## {{% heading "whatsnext" %}}
1599
1408
1600
1409
<!--
1601
- For background information on design details for API priority and fairness, see
1410
+ - You can visit flow control [reference doc](/docs/reference/flow-control/) to learn more about troubleshooting.
1411
+ - For background information on design details for API priority and fairness, see
1602
1412
the [enhancement proposal](https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/1040-priority-and-fairness).
1603
- You can make suggestions and feature requests via [SIG API Machinery](https://github.com/kubernetes/community/tree/master/sig-api-machinery)
1413
+ - You can make suggestions and feature requests via [SIG API Machinery](https://github.com/kubernetes/community/tree/master/sig-api-machinery)
1604
1414
or the feature's [slack channel](https://kubernetes.slack.com/messages/api-priority-and-fairness).
1605
1415
-->
1606
- 有关 API 优先级和公平性的设计细节的背景信息,
1607
- 请参阅[ 增强提案] ( https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/1040-priority-and-fairness ) 。
1608
- 你可以通过 [ SIG API Machinery] ( https://github.com/kubernetes/community/tree/master/sig-api-machinery/ )
1609
- 或特性的 [ Slack 频道] ( https://kubernetes.slack.com/messages/api-priority-and-fairness/ ) 提出建议和特性请求。
1416
+ - 你可以查阅流控[ 参考文档] ( /zh-cn/docs/reference/flow-control/ ) 了解有关故障排查的更多信息。
1417
+ - 有关 API 优先级和公平性的设计细节的背景信息,
1418
+ 请参阅[ 增强提案] ( https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/1040-priority-and-fairness ) 。
1419
+ - 你可以通过 [ SIG API Machinery] ( https://github.com/kubernetes/community/tree/master/sig-api-machinery/ )
1420
+ 或特性的 [ Slack 频道] ( https://kubernetes.slack.com/messages/api-priority-and-fairness/ ) 提出建议和特性请求。
0 commit comments