Flow control [page]deterministic
API Priority and Fairness controls the behavior of the Kubernetes API server in an overload situation. You can find more information about it in the [API Priority and Fairness](/docs/concepts/cluster-administration/flow-control/) documentation.
## Diagnostics
Every HTTP response from an API server with the priority and fairness feature enabled has two extra headers: `X-Kubernetes-PF-FlowSchema-UID` and `X-Kubernetes-PF-PriorityLevel-UID`, noting the flow schema that matched the request and the priority level to which it was assigned, respectively. The API objects' names are not included in these headers (to avoid revealing details in case the requesting user does not have permission to view them). When debugging, you can use a command such as:
```shell kubectl get flowschemas -o custom-columns="uid:{metadata.uid},name:{metadata.name}" kubectl get prioritylevelconfigurations -o custom-columns="uid:{metadata.uid},name:{metadata.name}" ```
to get a mapping of UIDs to names for both FlowSchemas and PriorityLevelConfigurations.
## Debug endpoints
With the `APIPriorityAndFairness` feature enabled, the `kube-apiserver` serves the following additional paths at its HTTP(S) ports.
You need to ensure you have permissions to access these endpoints. You don't have to do anything if you are using admin. Permissions can be granted if needed following the [RBAC](/docs/reference/access-authn-authz/rbac/) doc to access `/debug/api_priority_and_fairness/` by specifying `nonResourceURLs`.
- `/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:
```shell kubectl get --raw /debug/api_priority_and_fairness/dump_priority_levels ```
The output will be in CSV and similar to this:
```none PriorityLevelName, ActiveQueues, IsIdle, IsQuiescing, WaitingRequests, ExecutingRequests, DispatchedRequests, RejectedRequests, TimedoutRequests, CancelledRequests catch-all, 0, true, false, 0, 0, 1, 0, 0, 0 exempt, 0, true, false, 0, 0, 0, 0, 0, 0 global-default, 0, true, false, 0, 0, 46, 0, 0, 0 leader-election, 0, true, false, 0, 0, 4, 0, 0, 0 node-high, 0, true, false, 0, 0, 34, 0, 0, 0 system, 0, true, false, 0, 0, 48, 0, 0, 0 workload-high, 0, true, false, 0, 0, 500, 0, 0, 0 workload-low, 0, true, false, 0, 0, 0, 0, 0, 0 ```
Explanation for selected column names: - `IsQuiescing` indicates if this priority level will be removed when its queues have been drained.
- `/debug/api_priority_and_fairness/dump_queues` - a listing of all the queues and their current state. You can fetch like this:
```shell kubectl get --raw /debug/api_priority_and_fairness/dump_queues ```
The output will be in CSV and similar to this:
```none PriorityLevelName, Index, PendingRequests, ExecutingRequests, SeatsInUse, NextDispatchR, InitialSeatsSum, MaxSeatsSum, TotalWorkSum workload-low, 14, 27, 0, 0, 77.64342019ss, 270, 270, 0.81000000ss workload-low, 74, 26, 0, 0, 76.95387841ss, 260, 260, …(trimmed)