Review API server request timeouts

Set API server request timeouts according to normal processing times and resource-protection needs.

Description

--request-timeout sets the API server’s default time limit for ordinary requests. The current default is one minute. Some request types, including watches, have separate timeout handling.

Potential impact

A long timeout lets slow requests hold connections and resources. A short one can interrupt normal work.

Remediation

Measure ordinary request durations before choosing a value. After the change, monitor load and timeout errors and test both normal operations and watches.

Examples

The Kubernetes 1.6.0 excerpts shorten 6m to 300s (five minutes). Both exceed the current default. Choose a value for the workload on your supported API server version.

Before

yaml
apiVersion: v1
kind: Pod
metadata:
  name: command-demo
spec:
  containers:
    - name: command-demo-container
      image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0
      command: ["kube-apiserver"]
      args: ["--request-timeout=6m"]

After

yaml
apiVersion: v1
kind: Pod
metadata:
  name: command-demo
spec:
  containers:
    - name: command-demo-container
      image: gcr.io/google_containers/kube-apiserver-amd64:v1.6.0
      command: ["kube-apiserver"]
      args: ["--request-timeout=300s"]

References