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.6.0.tar.gz
(15.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
kubexec-0.6.0-py3-none-any.whl
(17.5 kB
view details)
File details
Details for the file kubexec-0.6.0.tar.gz.
File metadata
- Download URL: kubexec-0.6.0.tar.gz
- Upload date:
- Size: 15.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13f4ed158bd1dce268330cb74d6ed2026a86362b0b46b2896f0cde03150156e1
|
|
| MD5 |
3c81be54f9d4e415966c547ab249ea20
|
|
| BLAKE2b-256 |
8933557ed3d8b983a9c95e6466d40d67e3f272689e28bd0bae04569ba5ece3f3
|
File details
Details for the file kubexec-0.6.0-py3-none-any.whl.
File metadata
- Download URL: kubexec-0.6.0-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13f68d64406d5b772c08fb2bd8ad474c41ff92ee7143e9323e2991d30b845844
|
|
| MD5 |
f114c1068562ed9c069c7a372de20afd
|
|
| BLAKE2b-256 |
c8cf082989b1b7f54e532e8bea102f2ac5885c73574689d817ffc25ed2011558
|