kubernetes_asyncio

Asyncio-based Python client library for the Kubernetes API, built on aiohttp.

SDK
PyPI
v36.1.0
436stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
57/100Fair
Development Activity60
Maintenance16
Community72
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
73/100Good
Architecture76
Code Quality78
Innovation66
Learning Curve70

kubernetes_asyncio is an asynchronous Python client for the Kubernetes API. It mirrors the official kubernetes-client/python library but is generated with an async-aware OpenAPI generator and built on aiohttp, so every API call is a non-blocking coroutine suitable for asyncio applications.

The library covers the full Kubernetes API surface — pods, deployments, services, and other resources — plus configuration loading from kubeconfig or in-cluster service accounts, resource watches, exec/log streaming, leader election, and a dynamic client for custom resources.

What You Get

  • A fully async client covering the complete Kubernetes API surface
  • Config loading from kubeconfig files or in-cluster service accounts
  • Resource watch support for streaming add/update/delete events
  • A dynamic client, leader election, and exec/log streaming utilities

Common Use Cases

  • Managing Kubernetes resources from asyncio-based Python services and operators
  • Watching cluster resources for changes without blocking the event loop
  • Streaming pod logs or exec sessions inside async tooling

Under The Hood

Architecture - The client package holds the OpenAPI-generated api methods, models, and an aiohttp-backed api_client; config resolves credentials from kubeconfig or in-cluster tokens, while watch, stream, dynamic, and leaderelection modules layer higher-level async capabilities over the raw client. Tech Stack - Pure Python 3.10+ built on aiohttp for the async HTTP transport, generated from Kubernetes’ swagger spec via an asynchronous fork of the OpenAPI generator; packaged with setuptools/pyproject. Code Quality - The repo carries an extensive test suite plus e2e tests (e2e_test/), CI, and codecov reporting, and ships py.typed for type checking; it is actively maintained by 50+ contributors. API Design - The surface intentionally parallels the official synchronous client, so users familiar with kubernetes-client/python adapt quickly — the main change is awaiting calls and using async with for the API client — giving an ergonomic path to async Kubernetes access.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search