Skip to main content

Execute commands and scripts on Kubernetes pods with Docker access

Project description

kubexec

Execute commands and scripts on Kubernetes pods with Docker access.

Installation

pip install -e .

Usage

kubexec [-h] [-d DOCKER_IMAGE] [-n NAMESPACE] [-p POD_NAME] 
        [-m MEMORY] [-c CPU] [-w WORKDIR] [-v VOLUME_MOUNT]
        [--config CONFIG] [--context CONTEXT] [--create-pod]
        [--cleanup] [--verbose] [--dry-run] TARGET

Examples

# Run a simple command
kubexec 'echo "Hello, Kubernetes!"'

# Use specific Docker image
kubexec -d python:3.9 'python -c "import sys; print(sys.version)"'

# Run with resource limits
kubexec -m 4Gi -c 2 'stress --cpu 2 --timeout 60s'

# Execute script file
kubexec ./my_script.sh

# Use existing pod
kubexec -p my-existing-pod 'ls -la'

# Volume mounting
kubexec -v /host/data:/pod/data 'ls /pod/data'

# Save output to local files (works like local commands)
kubexec "ls -la > output.txt"

# Bioinformatics example with SPAdes genome assembler
# This will create spades-out/ directory in your current working directory
kubexec -d community.wave.seqera.io/library/spades:4.1.0--77799c52e1d1054a \
    "spades.py -1 tests/reads/s_6_1.fastq.gz -2 tests/reads/s_6_2.fastq.gz -o spades-out"

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

kubexec-0.2.0.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

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

kubexec-0.2.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file kubexec-0.2.0.tar.gz.

File metadata

  • Download URL: kubexec-0.2.0.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for kubexec-0.2.0.tar.gz
Algorithm Hash digest
SHA256 bce8e0324f01f4a2b7adeb9fc445136f50e0d28ec0b2fd71657ad15afa129814
MD5 be09a1e361445989891cdfde652222c2
BLAKE2b-256 f3b247ff2907d5ab4d0e72727a25935e3f3e60cbffc3aa831fb43fde002c97e7

See more details on using hashes here.

File details

Details for the file kubexec-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: kubexec-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for kubexec-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 56bb1cf5b30643db8345b9405253d8b7f91f1962829be606210af3d3ad1815a2
MD5 2114c200cc410cbb169add1dd63899de
BLAKE2b-256 ea61c8022319bbb76f69a9266c0be7f3080f99491f90823ff1b9a762f63e6189

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