Contributing

Contributions are very welcome. Check out our open issues on GitHub.

Development environment

We recommend you develop kr8s inside a virtual environment. We use uv for builds, virtual environments and task running, but you can use whatever you prefer.

pip install uv
uv sync --dev

But there are many different tools out there so feel free to use whichever you prefer and install kr8s in development mode.

# Create/activate your Python environment
pip install -e .

Testing

Tests in kr8s are run with pytest. To handle testing again Kubernetes we also use kind via the pytest-kind plugin. Kind launches a Kubernetes cluster inside a single Docker container which is great for local development. All setup is handles via fixtures so as long as you have docker you can run the tests.

uv run task test

Or you can install the test dependencies and invoke pytest yourself.

pip install -e .[test]
pytest kr8s

Documentation

Documentation is built with Sphinx. You can build the docs locally.

uv run task docs-serve

Or you can install the docs dependencies and invoke sphinx-build or sphinx-autobuild yourself.

pip install -e .[docs]
sphinx-autobuild docs docs/_build --ignore 'docs/autoapi/**/*' --host 0.0.0.0

Linting

We lint kr8s with black and ruff. We recommend you install pre-commit to do this on each commit.

$ pip install pre-commit
$ pre-commit install
$ # You can manually run pre-commit on all files too
$ pre-commit run --all