kubernetes

The official, generated Python client for the Kubernetes API

SDK
PyPI
v36.0.3
7,647stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
94/100Excellent
Development Activity96
Maintenance96
Community84
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
74/100Good
Architecture80
Code Quality82
Innovation70
Learning Curve65

The kubernetes PyPI package is the official Python client library for the Kubernetes API, maintained under the kubernetes-client organization alongside sibling clients for Go, Java, and other languages. Like those siblings, its API surface (kubernetes/client/) is largely generated from the Kubernetes OpenAPI/Swagger specification, giving full coverage of every core and extension API resource with typed models rather than hand-maintained bindings that lag the API.

Beyond the generated REST client, the package includes hand-written convenience layers: kubernetes.config for loading kubeconfig files or in-cluster service-account credentials, kubernetes.watch for streaming resource-change events, kubernetes.stream for exec/attach/port-forward over the Kubernetes API, a leaderelection module for building highly-available controllers, and a separate kubernetes.aio asyncio-based client alongside the default synchronous one.

What You Get

  • A generated REST client (kubernetes.client) with typed models and API classes covering every Kubernetes API group and version
  • kubernetes.config for loading credentials from a kubeconfig file or from in-cluster service-account tokens automatically
  • kubernetes.watch for consuming Kubernetes watch streams (resource create/update/delete events) as a Python iterator
  • kubernetes.stream for exec, attach, and port-forward operations against running pods over the Kubernetes API
  • A leaderelection module for building highly-available controllers, and a kubernetes.aio package providing an asyncio-native client alongside the default synchronous one

Common Use Cases

  • Writing a Kubernetes controller or operator in Python that watches and reconciles custom or core resources
  • Building an internal CLI or automation script that creates, updates, or deletes Kubernetes resources programmatically
  • Streaming live pod logs or exec-ing into a running container from a Python script or web backend
  • Building a dashboard or internal tool that reads cluster state (pods, deployments, nodes) via the generated client
  • Writing an asyncio-based Kubernetes controller using the kubernetes.aio client for high-concurrency reconciliation loops

Under The Hood

Architecture - The package splits a large generated surface (kubernetes/client/, produced from the Kubernetes OpenAPI spec via scripts/update-client.sh and the shared swagger.json.unprocessed) from hand-written convenience modules: config/ (credential loading), watch/ (streaming watch events), stream/ (exec/attach/port-forward), leaderelection/ (HA controller support), informer/, dynamic/ (a dynamic, non-generated client for arbitrary/custom resources), and aio/ (the asyncio client built parallel to the sync one).

Tech Stack - Pure Python (99.9%), generated with OpenAPI Generator against the upstream Kubernetes Swagger/OpenAPI spec; the CLIENT_VERSION in setup.py is kept in lockstep with the Kubernetes API version it targets rather than following independent semver.

Code Quality - The kubernetes/e2e_test/ and per-module test/ directories provide both unit and end-to-end coverage (the e2e suite runs against a real or kind-provisioned cluster), and CI/CD is driven by k8s-ci-robot, the shared Kubernetes-org bot, reflecting the project’s integration with upstream Kubernetes release tooling and SIG API Machinery review process.

API Design - Because most of the client is generated directly from the OpenAPI spec, method and model names track the Kubernetes API’s own resource/verb naming exactly (e.g. CoreV1Api.list_namespaced_pod), which is highly consistent but verbose; the hand-written config, watch, stream, and dynamic modules exist specifically to smooth over ergonomics the generated client doesn’t cover on its own (auth loading, streaming, and working with resources not known at generation time).

Used by 10 apps in this directory

Python
100%
Apache 2.0

Agno

Devops · AI Development · Automation

41,774

Build, run, and manage agent platforms with a full production stack — SDK, runtime, and control plane included.

View details
93
Repo Health
87
Technical
67
Dependency
Built with
Python100%
Updated today
Python
90%
Apache 2.0

Apache Airflow

Data Engineering

46,530

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
66
Dependency
Built with
Python90%
Updated today
Python
54%
Other

authentik

Authentication · Security

24,980

The self-hosted Identity Provider that replaces Okta, Auth0, and Entra ID with a unified SSO platform supporting SAML, OAuth2/OIDC, LDAP, RADIUS, and WebAuthn.

View details
92
Repo Health
81
Technical
68
Dependency
Built with
Python54%
TypeScript33%
Updated today
Python
63%
Other

Keep

Devops · Automation · Monitoring

12,224

The open-source AIOps and alert management platform that unifies 130+ monitoring tools into a single pane of glass with AI-powered correlation, deduplication, and workflow automation.

View details
91
Repo Health
79
Technical
67
Dependency
Built with
Python63%
TypeScript36%
Updated today
Python
68%
MIT

Langflow

AI Agents · AI Development

153,450

Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.

View details
90
Repo Health
85
Technical
66
Dependency
Built with
Python68%
TypeScript22%
Updated today
Python
58%
Apache 2.0

MLflow

AI Development · Monitoring

27,573

The open source AI engineering platform for debugging, evaluating, monitoring, and optimizing production LLMs and agents at scale.

View details
97
Repo Health
86
Technical
68
Dependency
Built with
Python58%
TypeScript33%
Updated today
TypeScript
80%
Apache 2.0

nao

AI Development · Analytics

1,570

Build and deploy an open-source analytics agent that understands your data warehouse and answers business questions in plain English.

View details
83
Repo Health
76
Technical
68
Dependency
Built with
TypeScript80%
Python19%
Updated yesterday
TypeScript
94%
Other

OpenHands

AI Code Assistants · AI Development

84,452

The self-hosted developer control center for running AI coding agents — locally, in Docker, on VMs, or across cloud backends — with automation workflows for GitHub, Slack, and more.

View details
91
Repo Health
82
Technical
71
Dependency
Built with
TypeScript94%
Updated today
Python
39%
Apache 2.0

OpenSandbox

Developer Tools · Security

14,296

Secure, fast, and extensible sandbox runtime for AI agents with multi-language SDKs and Docker/Kubernetes runtimes.

View details
84
Repo Health
81
Technical
73
Dependency
Built with
Python39%
Go36%
Updated today

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