-
Notifications
You must be signed in to change notification settings - Fork 0
Getting Started
Biowilko edited this page Aug 5, 2026
·
5 revisions
pip install squarepegThis installs the squarepeg console script plus its runtime dependencies: click, kubernetes (the official Python client), and PyYAML.
Working on squarepeg itself instead of just using it? See Development for an editable install from a checkout of the repo.
- A working
kubectl-style kubeconfig — squarepeg uses the exact same resolution kubectl does ($KUBECONFIG, then~/.kube/config, current context). Ifkubectl get podsworks, squarepeg will too. (Running squarepeg itself as a container, with no kubeconfig at all? It falls back to the pod's own service account — see Execution Lifecycle → Connect to the cluster.) - Permission in your target namespace to create/watch/delete Pods (and Jobs, if you use
--mode job).
squarepeg run alpine echo "hello from a pod"squarepeg will:
- Print which kubeconfig context and namespace it's using (to
stderr, unless--quiet). - Build and create a Pod manifest.
- Wait for the container to start, failing fast if the image can't be pulled.
- Stream the container's
stdout/stderrto your terminal as it runs. - Wait for the container to terminate.
- Delete the Pod.
- Exit with the container's exit code.
See what would be created without touching the cluster:
squarepeg run --dry-run --cpus 0.5 -m 512m -e FOO=bar alpine echo hiThis prints the exact Pod manifest YAML — no cluster connection required at all. See Execution Lifecycle for details.
Run as a Job instead of a Pod:
squarepeg run --mode job alpine echo hiKeep the resource around afterwards for debugging:
squarepeg run --keep --name debug-me alpine sh -c "exit 7"
kubectl describe pod debug-meSee your fully resolved config (useful once you have config files layered):
squarepeg config show- CLI Reference for the full flag list.
-
Configuration once you want to stop repeating
--cpus/--memory/namespace/etc. on every invocation, or need to set Kubernetes fields squarepeg has no dedicated flag for (node selectors, tolerations, service accounts, PVCs, ...). -
Docker Compatibility to see exactly which
docker runflags are supported, and what to do instead for the ones that aren't.