Lightweight Python 3+ client library for Kubernetes (pykube-ng)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Henning Jacobs 1b9362cc24 pykube-ng user agent 2 years ago
pykube pykube-ng user agent 2 years ago
tests pykube-ng user agent 2 years ago
.gitignore skip tests, clean up build 2 years ago
.travis.yml fix twine package check 2 years ago Updated CHANGELOG round two 4 years ago
LICENSE initial port of code 6 years ago
Makefile pykube-ng user agent 2 years ago
Pipfile test API calls 2 years ago
Pipfile.lock test API calls 2 years ago
README.rst use Deployment instead of ReplicationController 2 years ago
setup.cfg Added Travis CI 5 years ago pykube-ng user agent 2 years ago
tox.ini skip tests, clean up build 2 years ago




Code Coverage





IMPORTANT: This is a fork of kelproject/pykube which is no longer maintained (archived)!

Python client library for Kubernetes


Kel is an open source Platform as a Service (PaaS) from Eldarion, Inc. that makes it easy to manage web application deployment and hosting through the entire lifecycle from development through testing to production. It adds components and tools on top of Kubernetes that help developers manage their application infrastructure. Kel builds on Eldarion's 7+ years experience running one of the leading Python and Django PaaSes.

For more information about Kel, see, follow us on Twitter @projectkel, and join our Slack team.


  • HTTP interface using requests using kubeconfig for authentication
  • Python native querying of Kubernetes API objects


To install pykube, use pip:

pip install pykube-ng


Query for all ready pods in a custom namespace:

Access any attribute of the Kubernetes object:

Selector query:

Watch query:

Create a Deployment:

Delete a Deployment:

Check server version:


pykube can be used together with HTTPie for Kubernetes command line querying goodness. For example:

pip install httpie
http pykube://minikube/api/v1/services

The above example will construct an HTTP request to the cluster behind the minikube context and show you the response containing all services.


  • Python 3.6+
  • requests (included in install_requires)
  • PyYAML (included in install_requires)

Local Development

You can run pykube against your current kubeconfig context, e.g. local Minikube:

To run PEP8 (flake8) checks and unit tests including coverage report:


The code in this project is licensed under the Apache License, version 2.0 (included in this repository under LICENSE).


Easiest way to contribute is to provide feedback! We would love to hear what you like and what you think is missing. Create an issue or ping try_except_ on Twitter.

PRs are welcome. Please also have a look at issues labeled with "help wanted".

Code of Conduct

In order to foster a kind, inclusive, and harassment-free community, the Kel Project follows the Contributor Covenant Code of Conduct.