Skip to main content

A Kubernetes API library

Project description

Test Codecov pre-commit.ci status Read the Docs PyPI PyPI - Python Version Kubernetes Version Support PyPI - Wheel PyPI - License

A simple, extensible Python client library for Kubernetes that feels familiar for folks who already know how to use kubectl.

Highlights

  • API inspired by kubectl to reduce developer learning curve.
  • Sensible defaults to reduce boiler plate.
  • No swagger generated code, human readable code only.
  • Also has an asynchronous API that can be used with asyncio and trio.
  • Client caching to reduce passing API objects around.
  • Batteries included by providing useful utilities and methods inspired by kubectl.

Quickstart

Installation

$ pip install kr8s

Client API

import kr8s

pods = kr8s.get("pods")

See the Client API docs for more examples.

Object API

from kr8s.objects import Pod

pod = Pod({
        "apiVersion": "v1",
        "kind": "Pod",
        "metadata": {
            "name": "my-pod",
        },
        "spec": {
            "containers": [{"name": "pause", "image": "gcr.io/google_containers/pause",}]
        },
    })

pod.create()

See the Object API docs for more examples.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kr8s-0.8.6.tar.gz (31.1 kB view hashes)

Uploaded Source

Built Distribution

kr8s-0.8.6-py3-none-any.whl (39.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page