kubernetes

The official, generated Python client for the Kubernetes API

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

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
94 /100 Excellent
Development Activity 96
Maintenance 96
Community 84
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
74 /100 Good
Architecture 80
Code Quality 82
Innovation 70
Learning Curve 65

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

AI Development · Automation · Devops

42,358

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

View details
93
Repo Health
87
Technical
66
Dependency
Built with
Python 100%
Updated 5 days ago
Python
89%
Apache 2.0

Apache Airflow

Data Engineering

46,995

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
64
Dependency
Built with
Python 89%
Updated 5 days ago
Python
55%
Other

authentik

Authentication · Security

25,758

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
66
Dependency
Built with
Python 55%
TypeScript 36%
Updated 5 days ago
Python
64%
Other

Keep

Automation · Devops · Monitoring

12,359

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
89
Repo Health
79
Technical
66
Dependency
Built with
Python 64%
TypeScript 36%
Updated 2 weeks ago
Python
69%
MIT

Langflow

AI Agents · AI Development

155,319

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

View details
90
Repo Health
85
Technical
65
Dependency
Built with
Python 69%
TypeScript 22%
Updated 5 days ago
Python
58%
Apache 2.0

MLflow

AI Development · Monitoring

28,154

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
66
Dependency
Built with
Python 58%
TypeScript 33%
Updated 5 days ago
TypeScript
83%
Apache 2.0

nao

AI Development · Analytics

1,702

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

View details
84
Repo Health
76
Technical
67
Dependency
Built with
TypeScript 83%
Python 17%
Updated 1 weeks ago
TypeScript
95%
Other

OpenHands

AI Code Assistants · AI Development

89,328

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
67
Dependency
Built with
TypeScript 95%
Updated 6 days ago
Python
38%
Apache 2.0

OpenSandbox

Developer Tools · Security

15,540

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

View details
85
Repo Health
81
Technical
72
Dependency
Built with
Python 38%
Go 35%
Updated 5 days ago

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