kubernetes: apiserver cannot limit request

What happened?

Does kube-apiserver have internal rate limiting measures, apart from Admission Control (APF) rate limiting which seems to control only the number of simultaneous requests being processed? Now, suppose a large number of requests are being sent to the kube-apiserver by pods accessing Kubernetes services, it can result in very high CPU load on the apiserver, subsequently causing timeouts and issues with processing regular requests as well as health probes.

What did you expect to happen?

The apiserver can limit the quantity of requests, not only those that need processing but all external access, in order to prevent a surge in CPU usage due to high volumes of traffic, which could impact functionality.

How can we reproduce it (as minimally and precisely as possible)?

you can set --max-mutating-requests-inflight=10 and --max-requests-inflight=10, then send a lot of request by tools.the kube-apiserver’s cpu very high and some request maybe not resoponded or overtime.

Anything else we need to know?

No response

Kubernetes version

$ kubectl version
# paste output here

Cloud provider

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Install tools

Container runtime (CRI) and version (if applicable)

Related plugins (CNI, CSI, …) and versions (if applicable)

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Comments: 23 (20 by maintainers)

Most upvoted comments

Agree with Mike.

Following up on my previous comment above - I think the mechanism that we need to protect against this problem is different:

  • in APF we’re currently limiting number of inflight-requests
  • for limiting the impact of crypto operations, we should rather have a QPS-based limit