Skip to content

Commit 46daba4

Browse files
authored
Merge pull request #22651 from MikeSpreitzer/doc-apf-debug
Document APF debug URL paths
2 parents 1b9a074 + 7080355 commit 46daba4

File tree

1 file changed

+62
-3
lines changed

1 file changed

+62
-3
lines changed

content/en/docs/concepts/cluster-administration/flow-control.md

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,9 @@ to get a mapping of UIDs to names for both FlowSchemas and
303303
PriorityLevelConfigurations.
304304

305305
## Observability
306+
307+
### Metrics
308+
306309
When you enable the API Priority and Fairness feature, the kube-apiserver
307310
exports additional metrics. Monitoring these can help you determine whether your
308311
configuration is inappropriately throttling important traffic, or find
@@ -365,9 +368,65 @@ poorly-behaved workloads that may be harming system health.
365368
long requests took to actually execute, grouped by the FlowSchema that matched the
366369
request and the PriorityLevel to which it was assigned.
367370

368-
369-
370-
371+
### Debug endpoints
372+
373+
When you enable the API Priority and Fairness feature, the kube-apiserver serves the following additional paths at its HTTP[S] ports.
374+
375+
- `/debug/api_priority_and_fairness/dump_priority_levels` - a listing of all the priority levels and the current state of each. You can fetch like this:
376+
```shell
377+
kubectl get --raw /debug/api_priority_and_fairness/dump_priority_levels
378+
```
379+
The output is similar to this:
380+
```
381+
PriorityLevelName, ActiveQueues, IsIdle, IsQuiescing, WaitingRequests, ExecutingRequests,
382+
workload-low, 0, true, false, 0, 0,
383+
global-default, 0, true, false, 0, 0,
384+
exempt, <none>, <none>, <none>, <none>, <none>,
385+
catch-all, 0, true, false, 0, 0,
386+
system, 0, true, false, 0, 0,
387+
leader-election, 0, true, false, 0, 0,
388+
workload-high, 0, true, false, 0, 0,
389+
```
390+
391+
- `/debug/api_priority_and_fairness/dump_queues` - a listing of all the queues and their current state. You can fetch like this:
392+
```shell
393+
kubectl get --raw /debug/api_priority_and_fairness/dump_queues
394+
```
395+
The output is similar to this:
396+
```
397+
PriorityLevelName, Index, PendingRequests, ExecutingRequests, VirtualStart,
398+
workload-high, 0, 0, 0, 0.0000,
399+
workload-high, 1, 0, 0, 0.0000,
400+
workload-high, 2, 0, 0, 0.0000,
401+
...
402+
leader-election, 14, 0, 0, 0.0000,
403+
leader-election, 15, 0, 0, 0.0000,
404+
```
405+
406+
- `/debug/api_priority_and_fairness/dump_requests` - a listing of all the requests that are currently waiting in a queue. You can fetch like this:
407+
```shell
408+
kubectl get --raw /debug/api_priority_and_fairness/dump_requests
409+
```
410+
The output is similar to this:
411+
```
412+
PriorityLevelName, FlowSchemaName, QueueIndex, RequestIndexInQueue, FlowDistingsher, ArriveTime,
413+
exempt, <none>, <none>, <none>, <none>, <none>,
414+
system, system-nodes, 12, 0, system:node:127.0.0.1, 2020-07-23T15:26:57.179170694Z,
415+
```
416+
417+
In addition to the queued requests, the output includeas one phantom line for each priority level that is exempt from limitation.
418+
419+
You can get a more detailed listing with a command like this:
420+
```shell
421+
kubectl get --raw '/debug/api_priority_and_fairness/dump_requests?includeRequestDetails=1'
422+
```
423+
The output is similar to this:
424+
```
425+
PriorityLevelName, FlowSchemaName, QueueIndex, RequestIndexInQueue, FlowDistingsher, ArriveTime, UserName, Verb, APIPath, Namespace, Name, APIVersion, Resource, SubResource,
426+
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,
427+
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,
428+
```
429+
371430
## {{% heading "whatsnext" %}}
372431

373432

0 commit comments

Comments
 (0)