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.5.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.5.0-py3-none-any.whl (14.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kubexec-0.5.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.5.0.tar.gz
Algorithm Hash digest
SHA256 c9f988bebd5567fe06f8c6e269cbf41183bb2a98667006be23e7bb20b089a9ed
MD5 10df84c91986a17004790cda4bbe49ba
BLAKE2b-256 9360db7bcd32e4fea4aea8e074f34c9a9c004ebe96cb321fa7a9fc52cde0d268

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kubexec-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 14.9 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 833f9184613fe29e36a7bfc7b52f92edbb13d7428a83c1fcc5043aef7345efa3
MD5 deb6095a6dd240c0dbf2e65808abf582
BLAKE2b-256 8969de0eabc8027b25f85b52862c1bb295ad4b64506af86b4800a13a30abf49e

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