This project has been archived by its maintainers, and is no longer receiving any updates.
k4s
A CLI tool for managing installations and Kubernetes operations.
It helps install and operate:
- VM-based products over SSH (systemd services, OS packages, file layout)
- Kubernetes-based products via Helm (with safer targeting via k8s contexts)
Installation
Recommended (isolated install):
pipx install k4s
Alternative:
pip install --upgrade k4s
Quick start
Initialize local state:
k4s init
Add a VM context (SSH target) and set it as current:
k4s context add prod-vm --type vm --host 10.0.0.10 --username root --password '...'
k4s context use-context prod-vm
k4s context ping
Add a K8s context and set it as current:
k4s context add demo-k8s --type k8s --kubeconfig ~/.kube/config --kubectl-context gke_demo --namespace sep
k4s context use-context demo-k8s
k4s context ping
Core concepts
Contexts (targets)
k4s always operates against a context:
- VM contexts: SSH connection info (host, username, auth)
- K8s contexts: kubeconfig + kubectl context + (optional) default namespace
If --context is omitted, k4s uses the current context (set via k4s context use-context).
Verbosity
-q/--quiet: only final results and errors (also suppresses update notices)- default: concise step output
-v: show step logs-vv: debug output
Dry run
Most commands support --dry-run to print the plan without applying changes.
Products and commands
VM products (SSH)
- Docker Engine:
k4s install docker - Nexus:
k4s install nexus - Dataiku:
k4s install dataiku - R integration (for an existing Dataiku install):
k4s install r
Health checks (works even if the product was not installed by k4s):
k4s status nexus
k4s status dataiku --context prod-vm
TLS:
k4s tls enable nexus --issuer self-signed --domain nexus.example.com
k4s tls enable dataiku --issuer acme --domain dss.example.com --email admin@example.com
Kubernetes products (Helm)
- ingress-nginx:
k4s install ingress-nginx - Starburst Enterprise:
k4s install starburst - Starburst components:
k4s install hive|ranger|cache - Datafloem:
k4s install datafloem
Upgrades:
k4s upgrade starburst --force
k4s upgrade datafloem
Example Helm values files:
- See
examples/helm-values/
Kubernetes clusters (RKE2)
Create an RKE2 cluster using VM node contexts:
k4s cluster preflight --control-plane cp1 --worker w1
k4s cluster create --name lab --type rke2 --control-plane cp1 --worker w1 --cni canal
k4s cluster kubeconfig --name lab --control-plane cp1
Updates
When installed from PyPI, k4s checks once per day for a newer version and prints a notice:
Update available: 0.0.1a1 → 0.0.2 (run: pip install --upgrade k4s)
Development
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
pip install -e .
pytest
Metadata
Release files for k4s 0.0.1b2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| k4s-0.0.1b2.tar.gz | 121.0 kB | Without provenance | Details for k4s-0.0.1b2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| k4s-0.0.1b2-py3-none-any.whl | Python 3 | none | any | Details for k4s-0.0.1b2-py3-none-any.whl |
Total release size: 278.3 kB
Release files / k4s-0.0.1b2.tar.gz
| Download URL | k4s-0.0.1b2.tar.gz |
|---|---|
| Size | 121.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0a09c4d9247e8fda7330902153139b8a3d0600dffacce6b215e18b6f58f4556b
|
|
BLAKE2b-256 checksum How to use checksums |
ab391f98eefa115d683a58fd7266bd0b7a1a48418f17e2ddf6c0cad909b6f5f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Release files / k4s-0.0.1b2-py3-none-any.whl
| Download URL | k4s-0.0.1b2-py3-none-any.whl |
|---|---|
| Size | 157.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4ce7fc4fb2551d8f32d336c4484c4a8579105db8305787f5805428ffdabd65b7
|
|
BLAKE2b-256 checksum How to use checksums |
91606274e274dec4c0e2b2f7c0fd4c5a0f2817ed6442e9e0640a077b2f85d71d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Security for k4s 0.0.1b2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.