Skip to main content

More Info:

Set global request timeout for API server requests as appropriate.

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. Gather current configuration (control plane node)
    In the manifest, look under spec.containers[].command or ...args for --request-timeout=. If it is missing, the apiserver is using the default (60s as of recent versions).
  2. 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.
  3. 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.
  4. Update the kube-apiserver manifest (every control plane node)
    Open the manifest for editing:
    In the container command/args list, 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.
  5. 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).
  6. 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-timeout accordingly, repeating steps 4–5.
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.

Additional Reading: