Skip to main content

A command-line tool that provides a Docker-like interface for Kubernetes operations

Project description

CI Coverage PyPI License

Kodman

A command-line tool that provides a Docker-like experience with a Kubernetes backend.

An example use case would be to facilitate a single CI script where the runner may sometimes be a host with Docker (possibly run locally) and other times a Kubernetes executor where Docker-in-Docker is not possible (such as a Gitlab runner).

What Where
Source https://github.com/epics-containers/Kodman
PyPI pip install kodman
Releases https://github.com/epics-containers/Kodman/releases

Some examples:

Hello-world:

kodman run --rm hello-world

Handling exit codes:

kodman run --entrypoint bash --rm ubuntu -c "echo Enter; exit 1" && echo "You shall not pass"

Add files or directories into the pod filesystem:

mkdir demo
echo "Mellon" > demo/token.txt
kodman run -v ./demo:/demo --rm ubuntu bash -c "cat demo/token.txt"

Usage:

From outside of the cluster kodman will use your current Kubernetes context (the same as your current kubectl context).

From inside the cluster kodman will use the serviceAccount mounted by default.

Permissions

A minimal Kubernetes RBAC role definition can be found in .github/manifests

Design decisions

Why argparse over click/typer?

The docker cli api is not POSIX compliant.

For example: docker run --network=host imageID dnf -y install java

Click/Typer does not allow this (and is correct). They would expect: docker run --network=host imageID -- dnf -y install java

See Section 12.2 Guideline 10 https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html#tag_12_02

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

kodman-1.2.1.tar.gz (145.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kodman-1.2.1-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file kodman-1.2.1.tar.gz.

File metadata

  • Download URL: kodman-1.2.1.tar.gz
  • Upload date:
  • Size: 145.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kodman-1.2.1.tar.gz
Algorithm Hash digest
SHA256 6f1b3ed0322fd6ba473bcf0f12c76e6174e368a612885ec28768740b92e32003
MD5 9a62bb31fd6c22cb47f4022190e7ba57
BLAKE2b-256 f24a0ee803adf6905a39977f73f32c2e47db26af180eeb03a89337b6bef9c1ab

See more details on using hashes here.

File details

Details for the file kodman-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: kodman-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kodman-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d0cd6faeb0ddb3be4ac49f4cfa3926420310d28f3fc88aba035391919615952e
MD5 58c5ab9135d1d553833d4a7811539251
BLAKE2b-256 a435cf535d7fe55ef913e910299a83c832f1a728e27a7e587c2f37d4233770c3

See more details on using hashes here.

Supported by

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