Execute commands and scripts on Kubernetes pods with Docker access
Project description
kubexec
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.2.tar.gz
(15.3 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.2-py3-none-any.whl
(17.6 kB
view details)
File details
Details for the file kubexec-0.6.2.tar.gz.
File metadata
- Download URL: kubexec-0.6.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b220b246cb6e1e89fddec8375ac70b7cfda05c955ccb270d1fd3f6a20ba2c31
|
|
| MD5 |
6eaca4452d50ef57f95e8e928090eb12
|
|
| BLAKE2b-256 |
5544bee7efac8912980f203b025501469a7e8205215c4038a251bb2d67b1d83f
|
File details
Details for the file kubexec-0.6.2-py3-none-any.whl.
File metadata
- Download URL: kubexec-0.6.2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
46d0f3d117739564b2341f9dfb734320380a202d5bb556ac2717e8a2b1db61f3
|
|
| MD5 |
9ab79f12582b5b7b7cc5b15952f327bd
|
|
| BLAKE2b-256 |
43364ab6dab296aa7db15faea8d6f4ca22cfeeea513dfc878678a59358b8e1ed
|