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.1b1.tar.gz (142.8 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.1b1-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kodman-1.2.1b1.tar.gz
  • Upload date:
  • Size: 142.8 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.1b1.tar.gz
Algorithm Hash digest
SHA256 fa7969c9e90e7a46e86f9613a34318eb77df677e51da1f5e9d7a6c3ee031ee72
MD5 d7c5f692cabac1801678777540f84597
BLAKE2b-256 fbe7ecd8a9b29630d4a65ccf04fac03c0f0c31aa49ade82f4378f7fb6dd7efdf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kodman-1.2.1b1-py3-none-any.whl
  • Upload date:
  • Size: 18.4 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.1b1-py3-none-any.whl
Algorithm Hash digest
SHA256 676da60ba79efb43564ff1210aabb3b0dfb0294d5a84b49b214b0c3f35dc63e2
MD5 e873507b6c0c8d6fcd112da64ce324c0
BLAKE2b-256 969188fa1254ee45a9b3c3ab5ebce8d6c26958b6928606fdcd3e6705dae90f25

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