Skip to content

Concepts

This section explains the core design patterns behind Kubex. Read these pages to understand why the library is structured the way it is before diving into the operation and subresource guides.

  • :material-code-braces: Api[T]

    The generic Api[ResourceType] class, namespace vs cluster scope, the Ellipsis sentinel, and the create_api() factory.

  • :material-transit-connection-variant: Clients

    BaseClient ABC, create_client() auto-detection, and the difference between HttpxClient and AioHttpClient.

  • :material-cog: Configuration

    ClientConfiguration, auto-loading from kubeconfig or in-cluster pod environment, and exec credential providers.

  • :material-source-branch: Subresources

    The descriptor pattern, marker interfaces (HasLogs, HasExec, …), and how mypy enforces subresource availability at compile time.

  • :material-alert-circle: Exceptions

    The full exception hierarchy from KubexException down to HTTP-specific errors like NotFound and Conflict.