skillfed

kubernetes-asyncio

Kubernetes Asynchronous Python Client

kubernetes-asyncio v36.1.0 21.4M downloads/30d#1,002 on PyPI
Permissive license Apache-2.0 Active released

What it is and what it does

kubernetes_asyncio is an asynchronous Python client for the Kubernetes API, built using the OpenAPI generator to mirror the structure of the official synchronous client but with async/await support throughout. It allows developers to interact with Kubernetes clusters without blocking the event loop, making it suitable for concurrent operations like watching multiple resources, tailing pod logs, or orchestrating many API calls in parallel.

The library handles Kubernetes configuration loading, API client lifecycle management, and provides typed access to Kubernetes API groups. Dependencies include aiohttp for HTTP requests, pyyaml for config parsing, and standard utilities like certifi, urllib3, python-dateutil, and six. It targets modern Python versions and is versioned to align with Kubernetes release cycles.

Use it for:

  • Building event-driven Kubernetes operators or controllers that need to react to cluster changes without blocking.
  • Concurrent pod log streaming or multi-resource watching from a single Python process.
  • Orchestrating bulk Kubernetes operations with async concurrency without thread pools.
  • Integrating Kubernetes API calls into async web frameworks or async task queues.
  • Writing integration tests that need to poll Kubernetes state asynchronously while running other async tasks.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Asynchronous Python client for the Kubernetes API, enabling non-blocking interaction with Kubernetes clusters using AsyncIO.

Yes, if you need async Kubernetes API access in Python 3.10+. The library is actively maintained, has low install friction, carries no known vulnerabilities, and uses a permissive license. It is a direct fit for async-first applications; if your workload is synchronous or requires earlier Python versions, alternatives may be more suitable.

Install

kubernetes-asyncio on PyPI

pip

pip install kubernetes-asyncio

uv

uv add kubernetes-asyncio

poetry

poetry add kubernetes-asyncio

Installing kubernetes-asyncio

Before you install

Low install friction with a pure-Python wheel distribution. Maintenance status is active with a recent release within 71 days. Requires Python 3.10 or later.

License in practice

Licensed under Apache-2.0 (permissive), allowing use in commercial and private projects with minimal restrictions beyond attribution and liability disclaimers.

Quickstart

pip install kubernetes_asyncio

import asyncio
from kubernetes_asyncio import client, config
from kubernetes_asyncio.client.api_client import ApiClient

async def main():
    await config.load_kube_config()
    async with ApiClient() as api:
        v1 = client.CoreV1Api(api)
        ret = await v1.list_pod_for_all_namespaces()
        for pod in ret.items:
            print(pod.metadata.name)

asyncio.run(main())

Requires Python 3.10+. On Windows with client-go credential plugins, ProactorEventLoop must be explicitly set via asyncio.set_event_loop_policy().

Verify before relying

  • Feature parity with the synchronous kubernetes client and which Kubernetes API versions are fully supported.
  • Performance characteristics and concurrency limits when handling large numbers of simultaneous API requests.
  • Whether all Kubernetes API endpoints are covered or if some operations require falling back to synchronous alternatives.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 6 — aiohttp, certifi, python-dateutil, pyyaml, six, urllib3
Maintenance actively maintained — 71 days since the last release
First released
Downloads 21,434,572/month — #1,002 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: kubernetes_asyncio-36.1.0-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: Information TechnologyLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Utilities

Tags

kubernetes async clientasyncio kubernetes apinon-blocking k8s pythonkubernetes async python libraryasync kubernetes cluster managementkubernetes coroutine clientasync k8s api wrapper
async-iokubernetescontainer-orchestration

More Utilities packages