Installation¶
Kubex requires Python 3.10–3.14 and ships as a PEP 561 typed package.
Install¶
This installs the core library. To make actual requests to a Kubernetes cluster you need at least one HTTP client extra and one set of Kubernetes model packages.
HTTP client extras¶
Kubex supports two HTTP client backends. Install the one you prefer:
| Extra | Installs | WebSocket (exec/attach/portforward) | trio support |
|---|---|---|---|
kubex[aiohttp] |
aiohttp | Yes (built-in) | No |
kubex[httpx] |
httpx | No — add httpx-ws |
Yes |
kubex[httpx-ws] |
httpx + httpx-ws | Yes | Yes |
kubex[aiohttp]is the default and the first one auto-detected bycreate_client(). WebSocket support is built in.- Use
kubex[httpx]for the trio backend without WebSocket subresources. - Use
kubex[httpx-ws]when you needexec,attach, orportforwardwith the httpx backend.
Trio
Trio support is provided through the httpx backend only. kubex[aiohttp] works with asyncio only.
Kubernetes model packages¶
Kubex ships separate model packages per Kubernetes minor version. Install the package matching your cluster:
| Extra | Kubernetes version |
|---|---|
kubex[k8s-1.32] |
1.32 |
kubex[k8s-1.33] |
1.33 |
kubex[k8s-1.34] |
1.34 |
kubex[k8s-1.35] |
1.35 |
kubex[k8s-1.36] |
1.36 |
kubex[k8s-1.37] |
1.37 |
You can install multiple versions simultaneously when managing clusters at different upgrade stages:
See Multi-version Kubernetes for details.
Recommended combinations¶
For most users, pick one HTTP client and one K8s version:
Python version support¶
Kubex is tested and supported on Python 3.10 through 3.14.
Next steps¶
Once installed, head to the Quickstart to connect to your cluster and make your first request.