Overview
The constants module provides commonly used timeout values and exception dictionaries for handling transient cluster errors during API operations.Timeout Constants
Predefined timeout values in seconds for various operations.TIMEOUT_1SEC
TIMEOUT_5SEC
TIMEOUT_10SEC
TIMEOUT_30SEC
TIMEOUT_1MINUTE
TIMEOUT_2MINUTES
TIMEOUT_4MINUTES
TIMEOUT_10MINUTES
Exception Dictionaries
Dictionaries mapping exception types to lists of error message patterns. These are used withTimeoutSampler to automatically retry operations on transient cluster errors.
DEFAULT_CLUSTER_RETRY_EXCEPTIONS
Default exceptions that should trigger automatic retries during cluster operations.Exception Types
list[str]
Network-level retry errors. Empty list means retry on any MaxRetryError.
list[str]
Connection aborted errors. Empty list means retry on any ConnectionAbortedError.
list[str]
Connection reset errors. Empty list means retry on any ConnectionResetError.
list[str]
Kubernetes API server internal errors. Retries only on specific error messages:
- etcd leader changes
- etcd timeouts
- Webhook failures
- RPC errors
list[str]
API server timeout errors. Empty list means retry on any ServerTimeoutError.
list[str]
Forbidden errors caused by timeouts. Retries only on “context deadline exceeded”.