More Info:
Set global request timeout for API server requests as appropriate.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Gather current configuration (control plane node)
In the manifest, look under
spec.containers[].commandor...argsfor--request-timeout=. If it is missing, the apiserver is using the default (60s as of recent versions). -
Assess workload and operational requirements (any machine with access to cluster context)
Identify long-running API calls (e.g., big list/watch, backup/export, custom controllers):Work with application/platform owners to determine the maximum expected duration for legitimate API calls and whether any clients (operators, backups, CI/CD) regularly exceed 60s. -
Determine an appropriate timeout value (off-cluster decision step)
Based on step 2, agree on a value that:- Is longer than normal legitimate requests (e.g., 120–300s for clusters with heavy list operations).
- Is short enough to avoid hung connections consuming resources indefinitely.
Document the chosen value (e.g.,300s) and the rationale.
-
Update the kube-apiserver manifest (every control plane node)
Open the manifest for editing:In the containercommand/argslist, add or adjust the flag to the chosen value, for example:Save the file. Because this is a static pod manifest, the kubelet will automatically restart the API server pod with the new setting; expect a brief control-plane disruption during restart. -
Verify the new setting (every control plane node)
After the API server pod restarts, confirm the flag is applied:Ensure the output shows--request-timeout=300s(or your chosen value). -
Monitor for side effects (any machine with kubectl access)
Watch for errors/timeouts from controllers and clients after the change:If you observe legitimate operations failing due to timeouts, revisit steps 2–3 and adjust--request-timeoutaccordingly, repeating steps 4–5.
Using kubectl
Using kubectl
kubectl cannot modify the kube-apiserver pod manifest or its process flags, so it cannot be used to set the
--request-timeout argument. This setting must be changed directly in /etc/kubernetes/manifests/kube-apiserver.yaml on every control plane node; see the Manual Steps section for how to review and adjust it.Automation
Automation

