Skip to main content

Execute commands and scripts on Kubernetes pods with Docker access

Project description

kubexec

Kubekec logo

Execute commands and scripts on Kubernetes pods with Docker access.

Designed for use in CLIMB Notebooks.

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.6.1.tar.gz (15.3 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.6.1-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for kubexec-0.6.1.tar.gz
Algorithm Hash digest
SHA256 9b27749451fe61dfbda8b944de4a61ae65fc18a08dda9e00860a9c9589b00ef5
MD5 ac3558ef2c6090aa2afba64992fc86cc
BLAKE2b-256 2d5a9508c793a77d30e62dfb419758a204674d4e5b27fd0715a2add5b1a25457

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kubexec-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 17.6 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.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 783c02e11b74cdb63a0a87f7f963f30dc720d6ad3a484ebc6fbed2163d2df744
MD5 99177613c8854e8687cb83c90f1b6254
BLAKE2b-256 dba9724bd0e275253619d80936c6ae5d78ae26d1143aea7e6e2274306d11a49e

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