k7 -h for built-in help. Below are the primary commands.
install
Install K7 components on host node(s).- -v: verbose output
version
Check version of installed K7 .deb packagecreate
Create a sandbox from a YAML file or flags.YAML configuration reference
All fields map to the server-sideSandboxConfig:
- name (string, required): unique sandbox name.
- image (string, required): container image, e.g.
alpine:latest. - namespace (string, default
default): Kubernetes namespace. - env_file (string, optional): (absolute) path to an env file on the host node.
- egress_whitelist (array of CIDR strings, optional): allowed egress IPs, e.g.
"1.1.1.1/32"for single hosts or"10.0.0.0/8"for ranges. - limits (object, optional): resource limits:
- cpu (string): cores or millicores, e.g.
"1"or"500m". - memory (string): e.g.
"1Gi","512Mi". - ephemeral-storage (string): e.g.
"2Gi".
- cpu (string): cores or millicores, e.g.
- before_script (string, optional): shell script run once at container start.
- Runs with open egress; readiness waits for completion when set.
- pod_non_root (boolean, optional): run Pod as non-root (UID/GID/FSGroup 65532).
- container_non_root (boolean, optional): run container as non-root (UID 65532), no privilege escalation.
- cap_add (string[], optional): add back Linux capabilities (default policy drops ALL).
- cap_drop (string[], optional): override drop policy. If omitted,
ALLis dropped by default.
k7.yaml:
list
delete
delete-all
shell
logs
top
start-api
api-status
get-api-endpoint
stop-api
API keys
/etc/k7/api_keys.json. Use with X-API-Key or Authorization: Bearer.
Flag reference (create)
- -n, —namespace: Kubernetes namespace (default
default). - -f, —file: YAML config file (defaults to
k7.yamlwhen usingk7 create). - —name: Sandbox name (when not using YAML).
- —image: Container image (when not using YAML).
- —cpu: CPU limit (e.g.,
1,500m). - —memory: Memory limit (e.g.,
1Gi,512Mi). - —storage: Ephemeral storage limit (e.g.,
2Gi). - —env-file: Path to env file on the host node injected as a Secret.
- —egress CIDR: Repeatable; whitelist CIDR blocks for egress (omit to keep open; use none for full block).
- —before-script: Shell script to run once at start; runs with open egress before lockdown.
- —pod-non-root / —no-pod-non-root: Pod-level non-root defaults.
- —container-non-root / —no-container-non-root: Container runs as UID 65532, no privilege escalation.
- —cap-add CAP: Repeatable; add back Linux capabilities (default drop ALL).
- —cap-drop CAP: Repeatable; override default drop policy.
Package installs like
apk add require root inside the container. Either leave container_non_root disabled for setup or prebuild an image. See Security & networking: /api/security.