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).

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.0.tar.gz (31.3 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.0-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for kodman-1.2.0.tar.gz
Algorithm Hash digest
SHA256 c517205fb2ca760c81ec597fc0df86b972a7943af6a8df347be787122a785d16
MD5 daa1206af885a23502a36c6125cac9a9
BLAKE2b-256 cb2bcbea4680186cd17fdbf6fe9dad6246b1be24bbf6daea3476cc2558acd7ae

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for kodman-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9c35eff265f1bada933436e5a53f76cde1f028f674c9ba66bc4334a2169caa5
MD5 7add6f3715dd9a2000c1b51096b0eeda
BLAKE2b-256 78613fb6becdbc4b08fa329de045c98dfc45a5c552fcd96748f1f41d6aba846d

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